Adding icon cache to kdelibs?

Rivo Laks rivolaks at hot.ee
Fri Jun 22 13:52:30 BST 2007


Ühel kenal päeval (reede 22 juuni 2007) kirjutas Alexander Neundorf:
> On Tuesday 19 June 2007 12:30, Rivo Laks wrote:
> > Hi
> >
> > I'm the SoC student working on the icon cache.
> > I've already made some progress, e.g. at startup of apps KIconLoader ctor
> > (which is called for pretty much every app) takes 500 ms less with cold
> > caches, 30 ms less with hot caches. And the loading times of individual
>
> Cool :-)
> On what machine, which app ?

Machine is AMD Sempron 2800+ (1.6 GHz), with probably quite fragmented disk.
App was kdialog, but the icontheme initialization is pretty much same for all 
apps that use icons.

> > There will also be some buildsystem changes (I think these should go into
> > 4.0 even if the cache itself won't). Whenever new icons are installed,
> > the icon theme dir's (e.g. share/icons/oxygen/) mtime has to be updated,
> > then the icon cache will pick up the changes. There's already the
> > kde4_install_icons() cmake function which can easily be modified to do
>
> How do we touch on windows ?

Good question. I don't know much about win api/commands, so I can't answer 
that. Perhaps a small helper app can be created to do this with windows api?

> > that. But another function will need to be introduced for installing
> > icons into app's data dir (i.e. share/appname/...). It would install the
> > icons and then update mtime of hicolor icon directory. What about adding
>
> You mean installing to kde4/share/apps/... and then touching
> kde4/share/icons/hicolor/ ?

Exactly. The icon cache would then see that new icons are installed and would 
discard the whole cache. When the app icons are then requested, they'll be 
loaded from disk.

> > something like kde4_install_app_icons() for that?
>
> No, a special case in kde4_install_icons() will be better. If there is a
> fixed rule, we can do this in the script, then the developers don't have to
> remember it.

ATM apps install those icons like this:
    install( FILES icon.png  DESTINATION  ${DATA_INSTALL_DIR}/myapp/pics )
kde4_install_icons() is used like this:
    kde4_install_icons( ${ICON_INSTALL_DIR}  )

The syntaxes are quite different so I'm not sure about how easy/useful it is 
to merge them...

Rivo




More information about the kde-core-devel mailing list