summaryrefslogtreecommitdiff
path: root/src/file-manager
diff options
context:
space:
mode:
authorJasmine Hassan <[email protected]>2012-10-18 21:48:25 +0200
committerJasmine Hassan <[email protected]>2012-11-16 09:45:49 +0200
commitf170ef87e7968633dd4fb3e166e2e2ff0cfbba70 (patch)
tree01e7f1a619b4b7408f0910c28e136cc588fb1133 /src/file-manager
parent1a056cc77b431b2a013c052c78c0309ee52bc32b (diff)
downloadcaja-f170ef87e7968633dd4fb3e166e2e2ff0cfbba70.tar.bz2
caja-f170ef87e7968633dd4fb3e166e2e2ff0cfbba70.tar.xz
[tree-model] ony display the first emblem
Only display the first emblem we can render. http://git.gnome.org/browse/nautilus/commit/?id=1d660252b408f3628a2d3d5943abcf6bfdd9091b
Diffstat (limited to 'src/file-manager')
-rw-r--r--src/file-manager/fm-tree-model.c29
1 files changed, 12 insertions, 17 deletions
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;