Merge lp://qastaging/~3v1n0/sni-qt/icons-user-cache-on-snap into lp://qastaging/sni-qt

Proposed by Marco Trevisan (Treviño)
Status: Merged
Approved by: Lukáš Tinkl
Approved revision: 109
Merged at revision: 103
Proposed branch: lp://qastaging/~3v1n0/sni-qt/icons-user-cache-on-snap
Merge into: lp://qastaging/sni-qt
Prerequisite: lp://qastaging/~3v1n0/sni-qt/x11-usertime-on-activate
Diff against target: 149 lines (+57/-10)
5 files modified
src/fsutils.cpp (+16/-4)
src/iconcache.cpp (+11/-2)
src/iconcache.h (+2/-2)
src/statusnotifieritem.cpp (+1/-1)
tests/auto/iconcachetest.cpp (+27/-1)
To merge this branch: bzr merge lp://qastaging/~3v1n0/sni-qt/icons-user-cache-on-snap
Reviewer Review Type Date Requested Status
Lukáš Tinkl (community) Approve
Review via email: mp+311033@code.qastaging.launchpad.net

Commit message

IconCache: get the proper theme path based on the fact we're using a themed icon or not

If an app uses QIcon::fromTheme then we only have the icon name of it,
and thus we need to return a valid icon theme path. Now, it's not possible
to return the whole list of dirs, so we just fallback to the home icons
older, so that users might in case add icons there.

In $SNAP world, when using desktop-launcher ~/.local/share/icons also
contains all the themes in from /usr/share/icons and potentially more
(depending on the wrapper used for launching) so, we can be quite flexible
with it.

Also when running in a snap, save icons in $XDG_CACHE_HOME or in the user
cache, but still in an indicator readable location

Description of the change

To post a comment you must log in.
Revision history for this message
Lukáš Tinkl (lukas-kde) wrote :

You don't have to use QDir::separator(), it's even discouraged (http://doc.qt.io/qt-5/qdir.html#separator)

review: Needs Fixing
Revision history for this message
Lukáš Tinkl (lukas-kde) wrote :

Inline comment about the way you find the .cache directories

review: Needs Fixing
107. By Marco Trevisan (Treviño)

Don't use deprecated QDir::separator()

108. By Marco Trevisan (Treviño)

fsutils: add some comments about how we get the .cache

Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

Lukáš Tinkl (lukas-kde):
> Trevinho, I still have a slight doubt about ~/.cache; what if it doesn't exist? what creates it?

The subsequent call to dir.mkpath(".").

109. By Marco Trevisan (Treviño)

IconCache: try to get $XDG_DATA_HOME as base icon folders

Revision history for this message
Lukáš Tinkl (lukas-kde) wrote :

LGTM, working fine

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches