Fix icon loading in Widget Explorer
AbandonedPublic

Authored by davidedmundson on Jul 5 2016, 5:07 PM.

Details

Reviewers
None
Summary

In new Qt (not sure which version) QIcon::fromTheme(QString) returns a
valid icon object, thus hasThemeIcon always returns true as that simply
calls fromTheme internally and checks the names match.

This patch uses the same check as the new QIcon::fromTheme(QString
&name, QIcon fallback) to check the original icon was found.

This patch is therefore not only is a workaround but also a speed bost
as before we were effectively loading the same icon twice.

BUG: 365111

Diff Detail

Repository
R120 Plasma Workspace
Branch
Plasma/5.7
Lint
No Linters Available
Unit
No Unit Test Coverage
davidedmundson retitled this revision from to Fix icon loading in Widget Explorer.
davidedmundson updated this object.
davidedmundson edited the test plan for this revision. (Show Details)
Restricted Application added a project: Plasma. · View Herald TranscriptJul 5 2016, 5:07 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript

I know, I copied the "is this icon valid" from there.

I chose not to use it, partly because we don't have 5.7 and partly because it means you prematurely create the fallback qicon which is slightly additional overhead.

I think related to this change the standard fromTheme behaviour must have changed. Though its a bit hard to see with all this gtk icon cache changes in the log.

davidedmundson abandoned this revision.Jul 13 2016, 6:34 PM