From 8c4ed413d742024e0e919e1c65dea7b65fbc9637 Mon Sep 17 00:00:00 2001 From: Andras Mohari Date: Sat, 28 Jul 2007 10:16:06 +0200 Subject: [PATCH] Use the directory icon for mount points if the icon theme has no icon for mount points. --- ROX-Filer/src/type.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ROX-Filer/src/type.c b/ROX-Filer/src/type.c index 27097d20..1cfb39ba 100644 --- a/ROX-Filer/src/type.c +++ b/ROX-Filer/src/type.c @@ -386,6 +386,9 @@ MIME_type *mime_type_lookup(const char *type) * 3. Icon theme 'mime-base' * 4. Unknown type icon. * + * Special case: If an icon cannot be found for inode/mount-point, the icon for + * inode/directory will be returned (if possible). + * * Note: You must g_object_unref() the image afterwards. */ MaskedPixmap *type_to_icon(MIME_type *type) @@ -414,6 +417,7 @@ MaskedPixmap *type_to_icon(MIME_type *type) type->image = NULL; } +again: type_name = g_strconcat(type->media_type, "_", type->subtype, ".png", NULL); path = choices_find_xdg_path_load(type_name, "MIME-icons", SITE); @@ -463,6 +467,12 @@ MaskedPixmap *type_to_icon(MIME_type *type) HUGE_HEIGHT, 0); g_free(type_name); } + if (!full && type == inode_mountpoint) + { + /* Try to use the inode/directory icon for inode/mount-point */ + type = inode_directory; + goto again; + } if (full) { const char *icon_path; -- 2.11.4.GIT