check the new gnome-vfs icon_filename key. If that fails, fall back to

2002-09-11  Jeffrey Stedfast  <fejj@ximian.com>

	* mail-display.c (pixbuf_for_mime_type): check the new gnome-vfs
	icon_filename key. If that fails, fall back to checking
	icon-filename. Also don't leak the fm_icon string and rearranged
	some code.

svn path=/trunk/; revision=18044
This commit is contained in:
Jeffrey Stedfast
2002-09-11 19:39:48 +00:00
committed by Jeffrey Stedfast
parent 842c040cf1
commit b1cf9a7df7
2 changed files with 23 additions and 10 deletions

View File

@ -1,3 +1,10 @@
2002-09-11 Jeffrey Stedfast <fejj@ximian.com>
* mail-display.c (pixbuf_for_mime_type): check the new gnome-vfs
icon_filename key. If that fails, fall back to checking
icon-filename. Also don't leak the fm_icon string and rearranged
some code.
2002-09-11 Not Zed <NotZed@Ximian.com>
* component-factory.c (configure_folder_popup): Handle file uri's

View File

@ -532,34 +532,40 @@ pixbuf_for_mime_type (const char *mime_type)
const char *icon_name;
char *filename = NULL;
GdkPixbuf *pixbuf = NULL;
icon_name = gnome_vfs_mime_get_value (mime_type, "icon-filename");
/* GnomeVFS changed the key from icon-filename to
icon_filename, so check icon_filename first and if that
fails, fall back to the old key name */
if (!(icon_name = gnome_vfs_mime_get_value (mime_type, "icon_filename")))
icon_name = gnome_vfs_mime_get_value (mime_type, "icon-filename");
if (icon_name) {
if (*icon_name == '/') {
pixbuf = gdk_pixbuf_new_from_file (icon_name);
if (pixbuf)
return pixbuf;
}
filename = gnome_pixmap_file (icon_name);
if (!filename) {
char *fm_icon;
fm_icon = g_strdup_printf ("nautilus/%s", icon_name);
filename = gnome_pixmap_file (fm_icon);
if (!filename) {
g_free (fm_icon);
fm_icon = g_strdup_printf ("mc/%s", icon_name);
filename = gnome_pixmap_file (fm_icon);
}
g_free (fm_icon);
}
if (filename) {
pixbuf = gdk_pixbuf_new_from_file (filename);
g_free (filename);
}
}
if (filename) {
pixbuf = gdk_pixbuf_new_from_file (filename);
g_free (filename);
}
if (!pixbuf) {
filename = gnome_pixmap_file ("gnome-unknown.png");
if (filename) {
@ -571,7 +577,7 @@ pixbuf_for_mime_type (const char *mime_type)
(const char **)empty_xpm);
}
}
return pixbuf;
}