QIcon::fromTheme
Jeremy Whiting
jpwhiting at kde.org
Mon May 25 00:43:54 BST 2015
Albert,
Strace was the key. It was looking for and not finding an index.theme
in the hicolor folder on both machines. After adding that (copied from
/usr/share/icons/hicolor) it works fine on both machines. Even the one
where my current icon theme is in a different prefix.
thanks,
Jeremy
On Sun, May 24, 2015 at 10:52 AM, Albert Astals Cid <aacid at kde.org> wrote:
> El Diumenge, 24 de maig de 2015, a les 05:24:10, Jeremy Whiting va escriure:
>> Ok, that explains why it doesn't work on the kubuntu machine where
>> I've got breeze and such from packages. But why does it not work on
>> arch where all my icon themes are coming from kdesrc-build and are all
>> in /usr/local/share/icons ? I'm using breeze-dark or breeze, and both
>> are in /usr/local/share/icons here, so why doesn't it grab the hicolor
>> fallback theme icons from /usr/local/share/icons/hicolor when using
>> /usr/local/share/icons/breeze or breeze-dark ?
>
> I don't know, it is my understanding that it should work, have you straced it?
>
> Cheers,
> Albert
>
>>
>> BR,
>> Jeremy
>>
>> On Sat, May 23, 2015 at 9:38 PM, Albert Astals Cid <aacid at kde.org> wrote:
>> > El Dissabte, 23 de maig de 2015, a les 19:45:57, Jeremy Whiting va
> escriure:
>> >> Hello all,
>> >>
>> >> I'm confused about how QIcon::fromTheme works (or maybe how it's
>> >> supposed to work?) I've got Kmouth frameworks branch built and
>> >> installed into /usr/local on two different machines. In both cases it
>> >> installs phrase.png and phrasebook.png icons into
>> >> /usr/local/share/icons/hicolor/XxY/actions and XDG_DATA_DIRS is set so
>> >> QIcon::themeSearchPaths is giving /usr/local/share as one of the paths
>> >> it is searching. Yet QIcon::fromTheme(QLatin1String("phrase")) gives
>> >> no icon unless I copy the icon from
>> >> /usr/local/share/icons/hicolor/32x32/actions/ to
>> >> /usr/share/icons/hicolor/32x32/actions. I looked a bit in qicon.cpp
>> >> itself to see how it's doing that. and it's using some QIconEngine. Is
>> >> that creating an instance of our KIconEngine because the
>> >> frameworkintegration platformtheme gives that for it's
>> >> createIconEngine method? Is this a bug in KIconEngine itself that it's
>> >>
>> >> not searching the XDG paths specified by the icon spec? Any hints
>> >>
>> >> would be appreciated.
>> >
>> > Do you have a theme definition in /usr/local/share/icons/hicolor ? Probaby
>> > not, so when loading the icon from your theme (breeze, oxygen, whatever)
>> > that is most probably in /usr/share/icons/, why would the code fall back
>> > to a different "hicolor" theme?
>> >
>> > I understand what you want but i don't think icon themes work like that.
>> >
>> > Cheers,
>> >
>> > Albert
>> >>
>> >> thanks,
>> >> Jeremy
>
More information about the kde-core-devel
mailing list