From f170ef87e7968633dd4fb3e166e2e2ff0cfbba70 Mon Sep 17 00:00:00 2001 From: Jasmine Hassan Date: Thu, 18 Oct 2012 21:48:25 +0200 Subject: [tree-model] ony display the first emblem Only display the first emblem we can render. http://git.gnome.org/browse/nautilus/commit/?id=1d660252b408f3628a2d3d5943abcf6bfdd9091b --- src/file-manager/fm-tree-model.c | 29 ++++++++++++----------------- 1 file changed, 12 insertions(+), 17 deletions(-) (limited to 'src') diff --git a/src/file-manager/fm-tree-model.c b/src/file-manager/fm-tree-model.c index c7bcab10..3a3e3604 100644 --- a/src/file-manager/fm-tree-model.c +++ b/src/file-manager/fm-tree-model.c @@ -298,35 +298,30 @@ get_menu_icon_for_file (TreeNode *node, emblems_to_ignore[i++] = CAJA_FILE_EMBLEM_NAME_CANT_WRITE; } } - + emblems_to_ignore[i++] = NULL; emblem = NULL; emblem_icons = caja_file_get_emblem_icons (node->file, emblems_to_ignore); - if (emblem_icons != NULL) { - emblem_icon = emblem_icons->data; - emblem = g_emblem_new (emblem_icon); - emblemed_icon = g_emblemed_icon_new (gicon, emblem); - - g_object_unref (emblem); - - for (l = emblem_icons->next; l != NULL; l = l->next) { - emblem_icon = l->data; + /* pick only the first emblem we can render for the tree view */ + for (l = emblem_icons; l != NULL; l = l->next) { + emblem_icon = l->data; + if (caja_icon_theme_can_render (G_THEMED_ICON (emblem_icon))) { emblem = g_emblem_new (emblem_icon); - g_emblemed_icon_add_emblem - (G_EMBLEMED_ICON (emblemed_icon), emblem); + emblemed_icon = g_emblemed_icon_new (gicon, emblem); + g_object_unref (gicon); g_object_unref (emblem); - } + gicon = emblemed_icon; - eel_g_object_list_free (emblem_icons); - - g_object_unref (gicon); - gicon = emblemed_icon; + break; + } } + eel_g_object_list_free (emblem_icons); + info = caja_icon_info_lookup (gicon, size); retval = caja_icon_info_get_pixbuf_nodefault_at_size (info, size); model = node->root->model; -- cgit v1.2.1