Kirigami.Icon: Fix loading bigger images when source is a URL
ClosedPublic

Authored by apol on Aug 5 2019, 4:32 PM.

Details

Summary

Port to using the QImage::load() that takes a QIODevice and only do it when the
execution is finished, instead of upon readyRead(). This makes sure that we are
only processing the icon when is fully downloaded.

BUG: 407409
BUG: 400312

Test Plan

Reproduced the bug and fixed it

Diff Detail

Repository
R169 Kirigami
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 14781
Build 14799: arc lint + arc unit
apol created this revision.Aug 5 2019, 4:32 PM
Restricted Application added a project: Kirigami. · View Herald TranscriptAug 5 2019, 4:32 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
apol requested review of this revision.Aug 5 2019, 4:32 PM
apol updated this revision to Diff 63153.Aug 6 2019, 12:35 AM

simplify

broulik added a subscriber: broulik.Aug 6 2019, 6:38 AM
broulik added inline comments.
src/icon.cpp
406

Just noticed, doesn't the m_networkReply leak? It's not deleted in handleFinished

apol updated this revision to Diff 63167.Aug 6 2019, 10:52 AM

Also fix a memory leak

broulik added inline comments.Aug 6 2019, 10:58 AM
src/icon.cpp
412

Move this after the !reply check

424

What happens if you leave format nullptr, does it guess?

apol marked an inline comment as done.Aug 6 2019, 11:23 AM
apol added inline comments.
src/icon.cpp
424

yes, it seems to work.

apol updated this revision to Diff 63172.Aug 6 2019, 11:24 AM

Remove unneeded code

mart accepted this revision.Aug 6 2019, 1:27 PM
This revision is now accepted and ready to land.Aug 6 2019, 1:27 PM
This revision was automatically updated to reflect the committed changes.