Icon caching is unusable

Josselin Mouette joss at debian.org
Mon Oct 3 18:13:21 EEST 2005


Hi list,

Sorry if it's already been brought, but I can't find a clean way to use
the caching mechanism described in the icon theme specification. Here is
an excerpt from that specification:

        In order to handle this any implementation that does caching is
        required to look at the mtime of the toplevel icon directories
        when doing a cache lookup, unless it already did so less than 5
        seconds ago. This means that any icon editor or theme
        installation program need only to change the mtime of the the
        toplevel directory where it changed the theme to make sure that
        the new icons will eventually get used. 

This may sound good on the paper, but this way, icon caching is almost
unusable. Most of the time, the installation program won't change the
mtime of the toplevel directory. The icon theme specification has
existed for some time now without any caching implementation, and tools
are accustomed to just install icons in /usr/share/icons/$theme without
question.

The result is that icons are simply shipped into tarballs, .rpm or .deb
packages, or installed by automake. None of these tools changes the
mtime of the toplevel icon directory. The probability that even one of
these tools is changed to achieve that is close to zero. As such, it
isn't possible to use icon caching. Installing a new icon won't make it
appear automatically if you're using the cache.

The current way of dealing with this brokenness is to work around it
using scripts that run gtk-update-icon-cache - at least that's what
we've started to do for icons in Debian. However that's not how a cache
is supposed to work.

A possible way to go would be to check not only for the toplevel
directory's mtime, but also that of all directories referenced in
index.theme. However I'm afraid it would be suboptimal.

Other ideas?

Regards,
-- 
 .''`.           Josselin Mouette        /\./\
: :' :           josselin.mouette at ens-lyon.org
`. `'                        joss at debian.org
   `-  Debian GNU/Linux -- The power of freedom




More information about the xdg mailing list