Icon parameters in *.desktop files

Josselin Mouette joss at debian.org
Mon Jun 27 12:41:00 BST 2005


Le lundi 27 juin 2005 à 09:39 +0200, Alexander Larsson a écrit :
> On Fri, 2005-06-24 at 10:31 -0400, Rodney Dawes wrote:
> > On Thu, 2005-06-23 at 21:42 +0200, Josselin Mouette wrote:
> > > For each application, you would have to search through all available
> > > icons to see which ones are suitable.
> > 
> > No. With the Provides method, the implementation should just set up
> > aliases in memory and store that in the cache. The actual code for
> > parsing a comma separated list would be about the same whether it is
> > in the .desktop file parser, or in the icon theme parser. It would
> > probably actually be slower in the .desktop file side, since then it
> > would have to request every icon in the list, until it finds one,
> > while with the provides/aliases method, it can just make one request.
> 
> I'm not sure what you mean by this.
> 
> Consider the case of an app (file manager or something) that wants to
> show one desktop file. To pick the right icon you really need to read
> all files in the current icon theme, as any of them could have a line in
> it that says to use this icon for this particular desktop file. Reading
> all these files is a horrible performance problem.

Actually, his point is that this could be handled by the icon cache.
However this is not a solution, as in its current state, the icon cache
cannot be used without large changes at the distribution level. Even
with a fixed icon cache implementation, there would be many cases where
the cache is outdated, and the performance problems show up again.
Having a cache to make things go faster is good, but relying on the
cache being available for things to work isn't.

A more clever solution would be to put every Provides: in a single file;
maybe the index.theme file, maybe another one. It could look like:
[Icon]
Filename=scalable/graphics.svg
Applications=gimp,eog
MimeTypes=image/*,application/postscript
-- 
 .''`.           Josselin Mouette        /\./\
: :' :           josselin.mouette at ens-lyon.org
`. `'                        joss at debian.org
   `-  Debian GNU/Linux -- The power of freedom



More information about the kde-core-devel mailing list