Re: [Nautilus-list] Re: How does Nautilus choose an icon?



On Fri, 2001-11-02 at 10:08, Darin Adler wrote:
> on 11/2/01 9:35 AM, David Moles at david moles vykor com wrote:
> 
> > One other question (specifically a Nautilus one this time): What
> > determines the icon Nautilus uses for a particular MIME type?
> 
> Heh. You'd think that was a Nautilus one.
> 
> The gnome-vfs MIME database can have an icon filename listed for each MIME
> type under the key icon_filename.

Hmm... I followed Seth's suggestion and tracked down the
control-center-plus package, which got me the "File Types and Programs"
capplet back, and used that to add an icon for the text/x-lyx mime type
(which I was able to create successfully, by the way, and get Nautilus
to recognize); but Nautilus still uses the standard text-thumbnail
display. So I must still be missing something. Maybe I'll try creating
a gnome-text-x-lyx.png in... where? /usr/share/pixmaps/nautilus?

 If there's no icon filename listed for a
> MIME type, then the icon code uses the MIME type itself, turned into a
> filename by adding a "gnome-" prefix, and changing the "/" to a "-".
> Explicit icon filenames are only needed when the file is shared with another
> MIME type, or if the file already exists with some specific name for some
> other purpose.
> 
> That algorithm gives you the base of the icon's name, without a file type
> extension -- there's also code to strip off extensions for compatibility
> with old MIME database entries.
> 
> There's more to it, including special cases for special types of files like
> sockets that probably could be handled with MIME types too, but is not for
> historical reasons. The code is in get_icon_name_for_file and
> load_specific_icon in nautilus-icon-factory.c.

Thanks; I'll have a look. (Maybe this will finally be an incentive
for me to get serious about C. :>)

> Some day, after we add the metadata API into gnome-vfs, we'll be moving more
> of this icon logic into there too. It should be possible for any program to
> get the appropriate themed icon for any particular file or even for a
> particular MIME type using gnome-vfs.

Cool. 





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]