[nautilus] list-model: display only the first emblem



commit 5c08250adf30f2e24b4455fd3c08e81dc3ff4987
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Fri Aug 20 09:57:21 2010 +0200

    list-model: display only the first emblem
    
    Only display the first emblem we can render.

 src/file-manager/fm-list-model.c |   28 +++++++++++-----------------
 1 files changed, 11 insertions(+), 17 deletions(-)
---
diff --git a/src/file-manager/fm-list-model.c b/src/file-manager/fm-list-model.c
index 6cb4eec..f4905ab 100644
--- a/src/file-manager/fm-list-model.c
+++ b/src/file-manager/fm-list-model.c
@@ -327,32 +327,26 @@ fm_list_model_get_value (GtkTreeModel *tree_model, GtkTreeIter *iter, int column
 			}
 			emblems_to_ignore[i++] = NULL;
 
-			emblem = NULL;
 			emblem_icons = nautilus_file_get_emblem_icons (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 list view */
+			for (l = emblem_icons; l != NULL; l = l->next) {
+				emblem_icon = l->data;
+				if (nautilus_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);
+
 			icon_info = nautilus_icon_info_lookup (gicon, icon_size);
 			icon = nautilus_icon_info_get_pixbuf_at_size (icon_info, icon_size);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]