Re: [Nautilus-list] [PATCH] handling icon for mime types



On sáb, 2002-04-20 at 22:33, Alex Larsson wrote:
> On 20 Apr 2002, Diego González wrote:
> 
> > On sáb, 2002-04-20 at 21:15, Alex Larsson wrote:
> > > On 20 Apr 2002, Diego González wrote:
> > > 
> > > > hi
> > > > 
> > > > 	this this patch makes nautilus get the correct icon when an icon
> > > > different from the standard has been selected for a mime type or when
> > > > the applications that handle that type haven been changed from the mime
> > > > types capplet. (hope it is clear enough).
> > > > 
> > > > 	as an example of what i'm meaning: 
> > > > 
> > > > 	a) from the mime types capplet select and application different from
> > > > the default one to handle a certain type of mime type, 
> > > > 	b) restart nautilus (so that the mime database is reloaded, this is
> > > > another bug)
> > > > 	c) know, you should see the default white icon for the mime type that
> > > > you just modified, even thought you didn't change it specifically.
> > > 
> > > I don't really understand what you mean. Does the default application 
> > > registered for a mimetype change the icon for files with that mimetype? I 
> > > though icons were per-mimetype.
> > 
> > let me try to explain better: if you change the something (including the
> > icon) for a mime type, the next time you restart nautilus you will not
> > see the right icon for the mime type that you edited.
> > 
> > i hope this explanation is better
> 
> I tried to change the icon for application/x-font-bdf with the (gnome 1) 
> mimetype capplet. But it didn't work, with or without your patch.
> 
> Can you explain a bit more what you think is going wrong, and why your 
> patch fixes it?

ok, i used the gnome2 capplet. This capplet writes in the users mime
database the whole path of the icon (/home/diego/image.png). When
nautilus reaches the function make_full_icon_path. the parameters passed
to it when for the mime type that you just changed are: 

	path: the whole path to the image plus the icon without the 	extension
(/home/diego/image for example)
	suffix: .svg, because this is the first string in
	icon_file_name_suffixes

so, in the first check:

	if (path[0] == '/')
		return partial_path;

	we return a string, and the caller: get_themed_icon_file_path function,
considers that the file /home/diego/image.svg exists and is the right
one to use, but it doesn't exist, the right image to use whole be
/home/diego/image.png.

with the check: 

if (path[0] == '/' && g_file_test (partial_path, G_FILE_TEST_EXISTS)
	return partial_path;

we return *only* when the file with the right extension exists.

> 
> -- 
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>  Alexander Larsson                                            Red Hat, Inc 
>                    alexl redhat com    alla lysator liu se 
> He's a world-famous coffee-fuelled gangster with no name. She's an artistic 
> mute bodyguard who dreams of becoming Elvis. They fight crime! 






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