Bug 251288 - Icon cache is not updated at kde start - icon cache update tool needed
Summary: Icon cache is not updated at kde start - icon cache update tool needed
Alias: None
Product: kdelibs
Classification: Frameworks and Libraries
Component: kdeui (show other bugs)
Version: unspecified
Platform: Ubuntu Linux
: NOR wishlist
Target Milestone: ---
Assignee: Plasma Bugs List
: 289227 333083 (view as bug list)
Depends on:
Reported: 2010-09-15 11:08 UTC by Christoph Thielecke
Modified: 2014-07-16 16:56 UTC (History)
10 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:

ooo calc icon from 3.1.0 (3.54 KB, image/png)
2010-09-15 11:08 UTC, Christoph Thielecke

Note You need to log in before you can comment on or make changes to this bug.
Description Christoph Thielecke 2010-09-15 11:08:32 UTC
Created attachment 51667 [details]
ooo calc icon from 3.1.0

Version:           unspecified (using KDE 4.5.1) 
OS:                Linux

The icon cache will not updated at kde start. This could be problematic if icons has changed (file content). Then the old icon will be displayed instead the new one.

Reproducible: Didn't try

Steps to Reproduce:
Add quickstarter to plasma panel. Install Openoffice 3.2.0 from package. Put ooo calc from kmenu to quickstarter. Change /usr/share/icons/hicolor/16x16/apps/ooo-calc.png to another content (for example the attached). I think this is will be happen on every icon.

Actual Results:  
After kde restart old icon is displayed.

Expected Results:  
After kde restart new icon should be displayed.

If I delete ~/.kde/cache-<machine name>/icon-cache.kcache (/var/tmp/kdecache-<username>/icon-cache.kcache) it will be recreated with new data.
Comment 1 Christoph Feck 2010-09-16 22:02:29 UTC
I doubt this should be fixed.

The KDE icon cache is designed to keep its contents between KDE restarts. It can detect icon theme changes and this invalidates the cache.

Replacing single icons manually by the user, however, would result in a slower KDE start because it would need to check thousands of files if they have changed. We already suffer from slow start up speed. Additionally, users could expect the change to happen immediately.

Users that know how to change the icons in the (root-protected) file system manually can also manually clear the icon cache.

If you want to change the icon, select a different one. You can even select an icon that you installed into your home directory (in the icon chooser dialog, select "Other icons" and "Browse...". There is no need to swap images behind the back of an icon theme.

Keeping this bug open to collect further opinions.
Comment 2 Cyril Brosch 2011-05-11 11:36:23 UTC
I understand the argument of Christoph, but as it is now it doesn't work reliably.
Yesterday I noticed that the icon of one of my folders in folder view had changed, so just by chance I found out that Oxygen has new folder icons (since 4.6.3?).
I changed via config the icons of the other folder, but it worked only for folder-blue and folder-video, while e.g. folder-sound stayed the same in Dolphin or folderview, but on hovering the preview showed the new icon.
There was no change after reboot.
Why was one icon changed (I didn't do it)? Why does manual change apply to some icons and not to others? This is IMHO a highly unpolished and in any case inconsistent behaviour. 

I didn't know where to find the icon cache, in fact, I had no idea that that's the place to look. So I think there are others too, who don't have that knowledge and just whitness a strange behaviour of the icons.
Comment 3 Christoph Feck 2011-05-11 12:49:21 UTC
Cyril, if I understand you correctly, the icons got changed by a KDE update. The situation is that such an update does exactly what the reporter of the bug did: Files get overwritten by the package manager.

The ideal solution would be if the package came with a post-install script to clean the KDE icon cache. I guess we need a simple KDE command line tool to clear those caches, as it would be wired if the post-install script had to find out the location of the cache on its own.
Comment 4 Cyril Brosch 2011-05-11 12:59:18 UTC
Such a script would be a handy solution, as it would clear the cache only when really necessary and on the other hand would prevent such inconsistencies as I described.
Comment 5 Mahendra Tallur 2011-05-30 14:15:32 UTC
I noticed that, when creating a custom menu entry (for instance : a new application) with a PNG icon, and modifying the icon content afterwards (in my case, I had to add an alpha layer), the icon in the launcher would never be updated.

I had to rename the icon (re-selecting the same icon file in the fileselector wasn't sufficient to force an update).

This behaviour is probably not expected ?
Cheers & thanks everyone !
Comment 6 Christoph Feck 2011-12-17 21:16:51 UTC
*** Bug 289227 has been marked as a duplicate of this bug. ***
Comment 7 Martin Koller 2012-09-08 21:27:59 UTC
I rephrased the title for the wish to have an icon cache update tool and changed to wish.
Comment 8 Petr Kovács 2012-10-14 11:30:49 UTC
Mahendra Tallur: Exactly what I am dealing with right now. I have to rename the PNG file with the icon, or else the icon isn't updated. In my case the icon is invisible, because I deleted the old one and put there another with same filename - and the cache just remembered there was no icon so the application in the panel has "invisible" icon.
Comment 9 Christoph Feck 2014-04-05 00:08:17 UTC
*** Bug 333083 has been marked as a duplicate of this bug. ***
Comment 10 Ian Robertson 2014-07-16 16:56:19 UTC
Another userland perspective - I've been trying off and on for months to figure out why, regardless of what I did, an old icon I had set for an application refused to change. While changing an icon might not be a common user activity, when it does happen, this bug can definitely violate the Principle of Least Astonishment. Perhaps invalidating the cache, or at least refreshing the cache for the icon in question, would be in order when edits are done to the "Icon Settings" for an application.