diff options
author | Cosimo Cecchi <cosimoc@gnome.org> | 2014-09-09 15:37:19 -0700 |
---|---|---|
committer | Cosimo Cecchi <cosimoc@gnome.org> | 2014-09-09 15:49:13 -0700 |
commit | c123b6056b8a8f41ccdd8219d0f9bd91885141dd (patch) | |
tree | 2dcc0c3874e75f2326ff8c8698bd83dc218f9c21 /libnautilus-private | |
parent | 6eddc3851b361c892fa2903016a1c5d2cd6baf2b (diff) | |
download | nautilus-c123b6056b8a8f41ccdd8219d0f9bd91885141dd.tar.gz |
file: apply emblems to thumbnails too
Diffstat (limited to 'libnautilus-private')
-rw-r--r-- | libnautilus-private/nautilus-file.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/libnautilus-private/nautilus-file.c b/libnautilus-private/nautilus-file.c index 149cc0874..18d283994 100644 --- a/libnautilus-private/nautilus-file.c +++ b/libnautilus-private/nautilus-file.c @@ -4430,10 +4430,11 @@ nautilus_file_get_thumbnail_icon (NautilusFile *file, GdkPixbuf *pixbuf; int w, h, s; double thumb_scale; - GIcon *gicon; + GIcon *gicon, *emblemed_icon; NautilusIconInfo *icon; icon = NULL; + gicon = NULL; pixbuf = NULL; if (flags & NAUTILUS_FILE_ICON_FLAGS_FORCE_THUMBNAIL_SIZE) { @@ -4507,13 +4508,22 @@ nautilus_file_get_thumbnail_icon (NautilusFile *file, } if (pixbuf != NULL) { - icon = nautilus_icon_info_new_for_pixbuf (pixbuf, scale); + gicon = g_object_ref (pixbuf); + } else if (file->details->is_thumbnailing) { + gicon = g_themed_icon_new (ICON_NAME_THUMBNAIL_LOADING); } - if (icon == NULL && file->details->is_thumbnailing) { - gicon = g_themed_icon_new (ICON_NAME_THUMBNAIL_LOADING); - icon = nautilus_icon_info_lookup (gicon, size, scale); + if (gicon != NULL) { + emblemed_icon = apply_emblems_to_icon (file, gicon, flags); g_object_unref (gicon); + + if (g_icon_equal (emblemed_icon, G_ICON (pixbuf))) { + icon = nautilus_icon_info_new_for_pixbuf (pixbuf, scale); + } else { + icon = nautilus_icon_info_lookup (emblemed_icon, size, scale); + } + + g_object_unref (emblemed_icon); } return icon; |