summaryrefslogtreecommitdiff
path: root/src/nautilus-list-model.c
diff options
context:
space:
mode:
authorCosimo Cecchi <cosimoc@gnome.org>2014-09-07 21:46:15 -0700
committerCosimo Cecchi <cosimoc@gnome.org>2014-09-08 22:07:27 -0700
commita6b88ebde1eb82cf7692bf1c0a161ff6184e9188 (patch)
treecbbe3481218ec0c2aace265924250bf8c0211e7f /src/nautilus-list-model.c
parent150cfb7a325e7b3668cf4c386a043593a8361ce0 (diff)
downloadnautilus-a6b88ebde1eb82cf7692bf1c0a161ff6184e9188.tar.gz
file: apply emblems in nautilus_file_get_gicon()
We have duplicated code between the views - consolidate it inside nautilus_file_get_gicon().
Diffstat (limited to 'src/nautilus-list-model.c')
-rw-r--r--src/nautilus-list-model.c34
1 files changed, 4 insertions, 30 deletions
diff --git a/src/nautilus-list-model.c b/src/nautilus-list-model.c
index bf4b120bd..7da51501a 100644
--- a/src/nautilus-list-model.c
+++ b/src/nautilus-list-model.c
@@ -259,10 +259,6 @@ nautilus_list_model_get_value (GtkTreeModel *tree_model, GtkTreeIter *iter, int
NautilusFile *file;
char *str;
GdkPixbuf *icon, *rendered_icon;
- GIcon *gicon, *emblemed_icon, *emblem_icon;
- NautilusIconInfo *icon_info;
- GEmblem *emblem;
- GList *emblem_icons, *l;
int icon_size, icon_scale;
NautilusZoomLevel zoom_level;
NautilusFileIconFlags flags;
@@ -303,7 +299,9 @@ nautilus_list_model_get_value (GtkTreeModel *tree_model, GtkTreeIter *iter, int
flags = NAUTILUS_FILE_ICON_FLAGS_USE_THUMBNAILS |
NAUTILUS_FILE_ICON_FLAGS_FORCE_THUMBNAIL_SIZE |
- NAUTILUS_FILE_ICON_FLAGS_USE_EMBLEMS;
+ NAUTILUS_FILE_ICON_FLAGS_USE_EMBLEMS |
+ NAUTILUS_FILE_ICON_FLAGS_USE_ONE_EMBLEM;
+
if (model->details->drag_view != NULL) {
GtkTreePath *path_a, *path_b;
@@ -322,31 +320,7 @@ nautilus_list_model_get_value (GtkTreeModel *tree_model, GtkTreeIter *iter, int
}
}
- gicon = G_ICON (nautilus_file_get_icon_pixbuf (file, icon_size, TRUE, icon_scale, flags));
- emblem_icons = nautilus_file_get_emblem_icons (file);
-
- /* 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);
- emblemed_icon = g_emblemed_icon_new (gicon, emblem);
-
- g_object_unref (gicon);
- g_object_unref (emblem);
- gicon = emblemed_icon;
-
- break;
- }
- }
-
- g_list_free_full (emblem_icons, g_object_unref);
-
- icon_info = nautilus_icon_info_lookup (gicon, icon_size, icon_scale);
- icon = nautilus_icon_info_get_pixbuf_at_size (icon_info, icon_size);
-
- g_object_unref (icon_info);
- g_object_unref (gicon);
+ icon = nautilus_file_get_icon_pixbuf (file, icon_size, TRUE, icon_scale, flags);
if (model->details->highlight_files != NULL &&
g_list_find_custom (model->details->highlight_files,