lxqt / libqtxdg

Qt implementation of freedesktop.org xdg specs
https://lxqt.github.io
GNU Lesser General Public License v2.1
73 stars 35 forks source link

xdgiconloader: Puts the hicolor at the end of the theme hierarchy #126

Closed luis-pereira closed 7 years ago

luis-pereira commented 7 years ago

The hicolor theme is the ultimate resort. It should be allowed only at the end of the fallback hierarchy. We are allowing the hicolor theme to be in the middle of the theme hierarchy. Schematically: X -> hicolor -> Y -> Z -> hicolor If an icon exists in the hicolor and Y theme the hicolor one, is wrongly used.

This commit does four things:

luis-pereira commented 7 years ago

Using the Tangerine Icon Theme: Using https://github.com/lxde/libqtxdg/pull/116:

qtxdg-iconfinder system-reboot 
system-reboot:system-reboot:1243
    /usr/share/icons/hicolor/48x48/apps/system-reboot.png
Total loadIcon() time: 1243 ms

With this PR on top of https://github.com/lxde/libqtxdg/pull/116:

qtxdg-iconfinder system-reboot 
system-reboot:system-reboot:1398
    /usr/share/icons/oxygen/base/64x64/actions/system-reboot.png
    /usr/share/icons/oxygen/base/48x48/actions/system-reboot.png
    /usr/share/icons/oxygen/base/32x32/actions/system-reboot.png
    /usr/share/icons/oxygen/base/22x22/apps/system-reboot.png
    /usr/share/icons/oxygen/base/22x22/actions/system-reboot.png
    /usr/share/icons/oxygen/base/16x16/actions/system-reboot.png
    /usr/share/icons/oxygen/base/128x128/actions/system-reboot.png
Total loadIcon() time: 1398 ms

The wrong handling of the hicolor theme prevents the oxygen system-reboot to be found. This issue also affects Qt's QIconLoader. https://github.com/lxde/libqtxdg/pull/125 is the same PR, but rebased to the master branch.

p.s. Timing info is not accurate.

agaida commented 7 years ago

as far as i can see - it works mostly, only found one regression with quassel:

screen27

agaida@ramme /home % ps faux | grep quasse
agaida   21627  0.8  0.4 2521888 158972 ?      Sl   16:31   0:09 quasselclient
agaida    5416  0.0  0.0  35860   952 pts/0    S+   16:51   0:00      \_ grep --color=auto quasse
agaida@ramme /home % qtxdg-iconfinder quassel
quassel::5
        /usr/share/pixmaps/quassel.png
Total loadIcon() time: 5 ms
agaida@ramme /home % qtxdg-iconfinder quasselclient
quasselclient::8
Total loadIcon() time: 8 ms
agaida@ramme /home % qtxdg-iconfinder quassel-client
quassel-client::5
        /usr/share/pixmaps/quassel.png
Total loadIcon() time: 5 ms

quasselclient.desktop is

 /usr/share/applications/quasselclient.desktop
[Desktop Entry]
Type=Application
Version=1.0
Name=Quassel IRC (Client only)
Icon=quassel
TryExec=quasselclient
Exec=quasselclient
agaida commented 7 years ago

Additional info - this is with the applied PRs 116 and 126 - so i might miss one thing

116.patch
# 121.patch
126.patch
luis-pereira commented 7 years ago

@agaida Which icon theme are you using ?

agaida commented 7 years ago

faenza-ambiance

luis-pereira commented 7 years ago

@agaida Fixed. Pls update.

agaida commented 7 years ago

@luis-pereira works fine, the quassel-icon is back in the systray

agaida commented 7 years ago

after #125 is merged this PR should be obsolete? @luis-pereira - am i right?

luis-pereira commented 7 years ago

@agaida Right. Closing it.