D9812: [Icon Item] Treat sources starting with a slash as local file

Kai Uwe Broulik noreply at phabricator.kde.org
Thu Jan 11 09:40:48 UTC 2018


broulik created this revision.
broulik added reviewers: Plasma, hein.
Restricted Application added projects: Plasma, Frameworks.
Restricted Application added subscribers: Frameworks, plasma-devel.
broulik requested review of this revision.

REVISION SUMMARY
  We have a special case for sources starting with "file://" but a "/" also represents an absolute path and shouldn't conflict with icon theme names.
  Kicker sets a custom image as local path and then we would end up trying to load it as a `QIcon::fromTheme` eventually.
  This will cause the implicit size of the icon item to stay at its default as we only check a custom implicit size for a source `QImage` or an SVG. Moreover, this potentially introduces scaling artefacts.

TEST PLAN
  Unit test still passes. Comes with a new unit test to verify that non-square images get their proper implicit size set both when loaded as URL and local path. Fails before, passes with this fix.
  
  Kicker showing proper non-square icon again
  F5637456: Screenshot_20180111_103945.png <https://phabricator.kde.org/F5637456>

REPOSITORY
  R242 Plasma Framework (Library)

REVISION DETAIL
  https://phabricator.kde.org/D9812

AFFECTED FILES
  autotests/data/test_nonsquare.png
  autotests/iconitemtest.cpp
  autotests/iconitemtest.h
  src/declarativeimports/core/iconitem.cpp

To: broulik, #plasma, hein
Cc: plasma-devel, #frameworks, ZrenBot, progwolff, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20180111/2f778964/attachment.html>


More information about the Plasma-devel mailing list