From 90cde734c31e056fcbea1e8ac01a7135060af7aa Mon Sep 17 00:00:00 2001 From: Thomas Leonard Date: Tue, 29 Nov 2005 20:40:58 +0000 Subject: [PATCH] r4241: Better support for old GNOME themes with GNOME-specific MIME names (Dennis Tomas). --- ROX-Filer/Help/Changes | 2 ++ ROX-Filer/src/type.c | 17 +++++++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/ROX-Filer/Help/Changes b/ROX-Filer/Help/Changes index 967781b6..742b5178 100644 --- a/ROX-Filer/Help/Changes +++ b/ROX-Filer/Help/Changes @@ -5,6 +5,8 @@ ~~~~~~~~~~~ Removed 'Open AVFS' from menu. It doesn't do anything on most systems, and you can always add it with 'Customise menu...' if you want it (Thomas Leonard). +Better support for old GNOME themes with GNOME-specific MIME names (Dennis +Tomas). 21-Nov-2005 ~~~~~~~~~~~ diff --git a/ROX-Filer/src/type.c b/ROX-Filer/src/type.c index 112e86cc..f2b46e67 100644 --- a/ROX-Filer/src/type.c +++ b/ROX-Filer/src/type.c @@ -448,8 +448,11 @@ MaskedPixmap *type_to_icon(MIME_type *type) if (!full) { /* Ugly hack... try for a GNOME icon */ - type_name = g_strconcat("gnome-mime-", type->media_type, - "-", type->subtype, NULL); + if (type == inode_directory) + type_name = g_strdup("gnome-fs-directory"); + else + type_name = g_strconcat("gnome-mime-", type->media_type, + "-", type->subtype, NULL); full = gtk_icon_theme_load_icon(icon_theme, type_name, HUGE_HEIGHT, 0, NULL); @@ -464,6 +467,16 @@ MaskedPixmap *type_to_icon(MIME_type *type) HUGE_HEIGHT, 0, NULL); g_free(type_name); } + if (!full) + { + /* Ugly hack... try for a GNOME default media icon */ + type_name = g_strconcat("gnome-mime-", type->media_type, NULL); + + full = gtk_icon_theme_load_icon(icon_theme, + type_name, + HUGE_HEIGHT, 0, NULL); + g_free(type_name); + } if (full) { type->image = masked_pixmap_new(full); -- 2.11.4.GIT