summaryrefslogtreecommitdiff
path: root/gtk
diff options
context:
space:
mode:
authorRodney Dawes <dobey@novell.com>2005-12-14 19:32:04 +0000
committerRodney Dawes <dobey@src.gnome.org>2005-12-14 19:32:04 +0000
commit8c877d66889ee3845bcd4531fc7df0f9cbb7cb01 (patch)
treec373b5d8a89ffa3e129808b9551b1b31ae11e4ec /gtk
parent2d5b575ea0c7a7f6efebe97eb078e046167ff851 (diff)
downloadgdk-pixbuf-8c877d66889ee3845bcd4531fc7df0f9cbb7cb01.tar.gz
Default to "drive-harddisk" and then fall back to gnome-dev-harddisk
2005-12-14 Rodney Dawes <dobey@novell.com> * gtk/gtkfilesystemunix.c (gtk_file_system_unix_volume_render_icon): Default to "drive-harddisk" and then fall back to gnome-dev-harddisk (get_icon_for_mime_type): Look up the mime type icons according to the Icon Naming Specification and then fall back to the gnome-mime- prefix for the mime type icons Fixes #323655
Diffstat (limited to 'gtk')
-rw-r--r--gtk/gtkfilesystemunix.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/gtk/gtkfilesystemunix.c b/gtk/gtkfilesystemunix.c
index 68653e28c..31fc01c0c 100644
--- a/gtk/gtkfilesystemunix.c
+++ b/gtk/gtkfilesystemunix.c
@@ -808,6 +808,10 @@ gtk_file_system_unix_volume_render_icon (GtkFileSystem *file_system,
{
GdkPixbuf *pixbuf;
+ pixbuf = get_cached_icon (widget, "drive-harddisk", pixel_size);
+ if (pixbuf)
+ return pixbuf;
+
pixbuf = get_cached_icon (widget, "gnome-dev-harddisk", pixel_size);
if (pixbuf)
return pixbuf;
@@ -1291,6 +1295,23 @@ get_icon_for_mime_type (GtkWidget *widget,
if (!separator)
return NULL; /* maybe we should return a GError with "invalid MIME-type" */
+ icon_name = g_string_new ("");
+ g_string_append_len (icon_name, mime_type, separator - mime_type);
+ g_string_append_c (icon_name, '-');
+ g_string_append (icon_name, separator + 1);
+ pixbuf = get_cached_icon (widget, icon_name->str, pixel_size);
+ g_string_free (icon_name, TRUE);
+ if (pixbuf)
+ return pixbuf;
+
+ icon_name = g_string_new ("");
+ g_string_append_len (icon_name, mime_type, separator - mime_type);
+ g_string_append (icon_name, "-x-generic");
+ pixbuf = get_cached_icon (widget, icon_name->str, pixel_size);
+ g_string_free (icon_name, TRUE);
+ if (pixbuf)
+ return pixbuf;
+
icon_name = g_string_new ("gnome-mime-");
g_string_append_len (icon_name, mime_type, separator - mime_type);
g_string_append_c (icon_name, '-');