From kde-core-devel Tue Jun 19 16:30:08 2007 From: Rivo Laks Date: Tue, 19 Jun 2007 16:30:08 +0000 To: kde-core-devel Subject: Adding icon cache to kdelibs? Message-Id: <200706191930.09095.rivolaks () hot ! ee> X-MARC-Message: https://marc.info/?l=kde-core-devel&m=118240473827847 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 icons will be improved as well. As a result, I'd like to discuss a possibility of including the cache in 4.0 (instead of 4.1 as originally planned). The code can be found in /branches/soc-iconcache/ API changes to kdelibs would consist of one added method to KIconTheme (internalName()) and the addition of the KIconCache class. KIconCache's public API is pretty much complete (at least for 4.0). The most important methods are find() and insert() plus static deleteCache(). There is also possibility for apps to use their own caches, e.g. for saving pixmaps rendered from SVGs (at least kdeedu and kdegames might want to use this). A small app demonstrating this can be found in /branches/soc-iconcache/kic_demo The internals are not finished yet (and some of the code is quite messy), but I can finish that before the feature freeze. 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 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 something like kde4_install_app_icons() for that? So what do you think? Should it go into kdelibs for 4.0? If yes, I can do the merge before or on 25th (libs freeze). And any API improvement suggestions are of course also welcome :-) Rivo