Use new folder-stash icon
ClosedPublic

Authored by ngraham on Nov 8 2017, 2:08 PM.

Details

Summary
Test Plan

Tested in KDE Neon. Dolphin now uses the new icon is kio-stash is installed:

Diff Detail

Repository
R318 Dolphin
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
ngraham created this revision.Nov 8 2017, 2:08 PM
ngraham edited the test plan for this revision. (Show Details)Nov 8 2017, 2:17 PM
elvisangelaccio requested changes to this revision.Nov 8 2017, 5:10 PM
elvisangelaccio added inline comments.
src/dolphinmainwindow.cpp
1099

Please use the old folder-stash icon as fallback (in the fromTheme call), in case the user has a version of breeze-icons older then 5.40

This revision now requires changes to proceed.Nov 8 2017, 5:10 PM
ngraham updated this revision to Diff 22109.Nov 9 2017, 3:13 AM

Fall back to the old folder-visiting icon if folder-stash isn't available

ngraham marked an inline comment as done.Nov 9 2017, 3:13 AM
cfeck added a subscriber: cfeck.Nov 9 2017, 11:03 AM
cfeck added inline comments.
src/dolphinmainwindow.cpp
1099

This probably does not compile, see http://doc.qt.io/qt-5/qicon.html#fromTheme-1

cfeck added inline comments.Nov 9 2017, 11:10 AM
src/dolphinmainwindow.cpp
1099

EDIT: Actually, it probably does compile, but you want QIcon::fromTheme() as a fallback, not an icon loaded from a filename, which is the implicit result of QIcon(QString).

cfeck added inline comments.Nov 9 2017, 11:14 AM
src/dolphinmainwindow.cpp
1099

And thinking about it, fallbacks with QIcon::fromTheme() are probably useless, because our icon loader does automatic fallback according to XDG spec. In other words, if "folder-stash" is not available, it will load "folder". Even if this was not available, it would load a default "unknown" icon.

If you really want the fallback to a different icon to work, you probably need to use KIconLoader classes directly.

ngraham updated this revision to Diff 22121.Nov 9 2017, 2:12 PM

Correctly invoke QIcon::fromTheme()'s fallback behavior

ngraham marked 2 inline comments as done.Nov 9 2017, 2:13 PM
src/dolphinmainwindow.cpp
1099

And thinking about it, fallbacks with QIcon::fromTheme() are probably useless, because our icon loader does automatic fallback according to XDG spec. In other words, if "folder-stash" is not available, it will load "folder".

Oh, that's probably good enough then.
@ngraham can you restore the first version of this diff?

ngraham updated this revision to Diff 22148.Nov 10 2017, 4:19 PM

Restoring original diff

ngraham marked 2 inline comments as done.Nov 10 2017, 4:20 PM
elvisangelaccio accepted this revision.Nov 10 2017, 4:35 PM
This revision is now accepted and ready to land.Nov 10 2017, 4:35 PM
ngraham closed this revision.Nov 10 2017, 4:36 PM