Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
wants to merge 3 commits into from

Conversation

luis-pereira
Copy link
Member

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:
* Stops adding the hicolor theme to each theme as a fallback.
* Stops adding the hicolor as a parent theme, even if added by the
index.theme Inherits key. The oxygen theme does it.
* Stops return the hicolor theme in the fallbackTheme().
* Adds the hicolor theme to the end of the fallback hierarchy list.

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:
    * Stops adding the hicolor theme to each theme as a fallback.
    * Stops adding the hicolor as a parent theme, even if added by the
index.theme Inherits key. The oxygen theme does it.
    * Stops return the hicolor theme in the fallbackTheme().
    * Adds the hicolor theme to the end of the fallback hierarchy list.
@luis-pereira
Copy link
Member Author

Using the Tangerine Icon Theme:
Using #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 #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. #125 is the same PR, but rebased to the master branch.

p.s. Timing info is not accurate.

@agaida
Copy link
Member

agaida commented Apr 8, 2017

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
Copy link
Member

agaida commented Apr 8, 2017

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
Copy link
Member Author

@agaida Which icon theme are you using ?

@agaida
Copy link
Member

agaida commented Apr 9, 2017

faenza-ambiance

@luis-pereira luis-pereira force-pushed the fix-hicolor-position branch 2 times, most recently from 29ea369 to c61fd1a Compare April 11, 2017 11:10
@luis-pereira
Copy link
Member Author

@agaida Fixed. Pls update.

Their place is after the hicolor theme.
And they should be searched one time only, after the hicolor theme.
@agaida
Copy link
Member

agaida commented Apr 11, 2017

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

Unthemed icons should be search only one time, after the hicolor theme.
We are using QIcon::themeSearchPaths() to provide the list of directories
and it doesn't depend on the theme.
@agaida
Copy link
Member

agaida commented May 4, 2017

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

@luis-pereira
Copy link
Member Author

@agaida Right. Closing it.

@luis-pereira luis-pereira deleted the fix-hicolor-position branch May 4, 2017 18:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants