D13054: SwipeItem: Fix using QRC resources and custom image providers.
This revision was automatically updated to reflect the committed changes. Closed by commit R169:db6ef33cfa9b: Allow qrc assets to be used in Actions icons (authored by lepagevalleeemmanuel). CHANGED PRIOR TO COMMIT https://phabricator.kde.org/D13054?vs=34689&id=39204#toc REPOSITORY R169 Kirigami CHANGES SINCE LAST UPDATE https://phabricator.kde.org/D13054?vs=34689&id=39204 REVISION DETAIL https://phabricator.kde.org/D13054 AFFECTED FILES src/controls/templates/SwipeListItem.qml src/desktopicon.cpp To: lepagevalleeemmanuel, mart Cc: broulik, plasma-devel, apol, davidedmundson, mart, hein
D13054: SwipeItem: Fix using QRC resources and custom image providers.
broulik added inline comments.
INLINE COMMENTS
> desktopicon.cpp:440
> +// QRC paths are not correctly handled by .path()
> +if (iconId.size() >=2 && iconId.left(2) == QLatin1String("/:"))
> +iconId = iconId.remove(0, 1);
`startWith()` avoids creating a temporary string just for comparison
REPOSITORY
R169 Kirigami
REVISION DETAIL
https://phabricator.kde.org/D13054
To: lepagevalleeemmanuel, mart
Cc: broulik, plasma-devel, apol, davidedmundson, mart, hein
D13054: SwipeItem: Fix using QRC resources and custom image providers.
mart accepted this revision.
mart added inline comments.
This revision is now accepted and ready to land.
INLINE COMMENTS
> desktopicon.cpp:440
> +// QRC paths are not correctly handled by .path()
> +if (iconId.size() >=2 && iconId.left(2) == QLatin1String("/:"))
> +iconId = iconId.remove(0, 1);
use the kdelibs style, with {} always present
REPOSITORY
R169 Kirigami
REVISION DETAIL
https://phabricator.kde.org/D13054
To: lepagevalleeemmanuel, mart
Cc: plasma-devel, apol, davidedmundson, mart, hein
D13054: SwipeItem: Fix using QRC resources and custom image providers.
lepagevalleeemmanuel created this revision.
lepagevalleeemmanuel added a reviewer: mart.
Restricted Application added a project: Kirigami.
Restricted Application added a subscriber: plasma-devel.
lepagevalleeemmanuel requested review of this revision.
REVISION SUMMARY
This patch does 2 things.
1. Check for the iconSource as defined in Action.qml
2. Mitigate the misuse of QUrl in desktopicon.cpp
Note that this isn't 100% correct. Imageprovider strings are not really URL,
they are URI, it can be anything and include URI arguments. I think the proper
solution would be to check exactly what QML does when ocnversion `image://`
into identifier and do exactly that. Right now a string that works in `Image{}`
and was valid per the image provider doc was modified by QUrl into something
else.
TEST PLAN
Manual testing
REPOSITORY
R169 Kirigami
REVISION DETAIL
https://phabricator.kde.org/D13054
AFFECTED FILES
src/controls/templates/SwipeListItem.qml
src/desktopicon.cpp
To: lepagevalleeemmanuel, mart
Cc: plasma-devel, apol, davidedmundson, mart, hein
