Add support for remote image sources to DesktopIcon
ClosedPublic

Authored by leinir on May 8 2017, 1:17 PM.

Details

Summary

This adds support for images hosted on http(s) remotes to the DesktopIcon item. It uses the qnam from the qqmlengine the item is associated with to do the fetching (and supports redirection, and will prefer cached images when available).

Test Plan

Used in Discover, where the QIconItem can, with this code, be replaced with DesktopIcon items.

Diff Detail

Repository
R169 Kirigami
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
leinir created this revision.May 8 2017, 1:17 PM
Restricted Application added a project: Kirigami. · View Herald TranscriptMay 8 2017, 1:17 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
apol edited edge metadata.May 8 2017, 2:59 PM

Don't we also have to add support for when DesktopIcon::m_source is a QIcon?

leinir added a comment.May 8 2017, 3:04 PM
In D5764#108019, @apol wrote:

Don't we also have to add support for when DesktopIcon::m_source is a QIcon?

That's already covered in DesktopIcon::updatePaintNode's big switch statement, where it checks for what type is actually inside m_source (heh, i thought it was in the patch, but that whole switch statement's not changed in the end) :) https://cgit.kde.org/kirigami.git/tree/src/desktopicon.cpp#n256

mart accepted this revision.May 8 2017, 7:06 PM
mart added inline comments.
src/desktopicon.cpp
366

coding style, space between if and (
(in some other places as well)

This revision is now accepted and ready to land.May 8 2017, 7:06 PM
This revision was automatically updated to reflect the committed changes.