RCC for icons - update: Re: Icons installed by apps

Jaroslaw Staniek staniek at kde.org
Mon Mar 7 16:29:40 UTC 2016


On 7 March 2016 at 13:05, Kåre Särs <kare.sars at iki.fi> wrote:

> Hi,
>
> On Monday, March 07, 2016 12:41:52 PM Jaroslaw Staniek wrote:
> > >
> > > ​Thanks, it works on Windows (no platform theme).
> > > ​​How to make it work on Linux too (KF5 5.19.0, Qt 5.5.1), i.e. I'd
> like
> > > to have only used icons from the .rcc regardless of availability of
> > > FrameworkIntegrationPlugin.so KDEPlatformTheme.so?
> > > ​
> > > We're talking about this code:​
> > >
> > > ​https://quickgit.kde.org/?p=kate.git&a=blob&f=icons.h​​​
> > >
> > > As soon as QResource::registerResource("breeze.rcc") is called,
> ":/icons"
> > > is
> > > ​appended to the theme search path (checked using
> > > QIcon::themeSearchPaths()).
> > >
> > > There's a line QIcon::setThemeSearchPaths(QStringList() <<
> > > QStringLiteral(":/icons")).
> > >
> > > - When I have this line enabled and I have no
> > > FrameworkIntegrationPlugin.so & KDEPlatformTheme.so installed, no icons
> > > are
> > > available at all
>
> Notice that the setThemeSearchPaths() call _replaces_ any previous search
> paths. Is this your problem?
>
>
>
​No.. but I got it sorted out after reading QIconTheme::QIconTheme and
alike and re-reading the "The name should correspond to a directory name in
the themeSearchPath() containing an index.theme file describing it's
contents" sentence of  QIcon::setThemeName docs :)

I was tricked by the fact that on Windows qrc files with these paths work:

<file>./icons/actions/16/code-block.svg</file>
<file>./icons/actions/16/code-class.svg</file>
etc.

And not on Linux. No idea why. Here I needed:

<file>./icons/breeze/actions/16/code-block.svg</file>
<file>./icons/breeze/actions/16/code-class.svg</file>

Of course also, otherwise the theme is marked as invalid
<file>./icons/breeze/index.theme</file>

(needed once; if you have the index.theme accessible from breeze.rcc, you
can add an extra application-defined .rcc without index.theme and new icons
will just be "added" to the theme. Looks like useful thing for plugins for
example, shipped completely separate from distros, and maybe not even
packaged. Just make sure you don't use any new subdirs that are are not
defined by the index file (I guess).

Now useful thing would be to have option to generate breeze.rcc directly in
breeze-icons.git, so apps can find breeze.rcc at configure time, e.g. using
FindBreezeIcons.cmake.

Thanks, sorry for the noise. All the relevant recipes would end up in a
howto and/or cmake scripts.
​

-- 
regards, Jaroslaw Staniek

KDE:
: A world-wide network of software engineers, artists, writers, translators
: and facilitators committed to Free Software development - http://kde.org
Calligra Suite:
: A graphic art and office suite - http://calligra.org
Kexi:
: A visual database apps builder - http://calligra.org/kexi
Qt Certified Specialist:
: http://www.linkedin.com/in/jstaniek
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20160307/8f2d73a6/attachment.html>


More information about the Kde-frameworks-devel mailing list