summaryrefslogtreecommitdiff
path: root/libgnome-desktop/gnome-desktop-thumbnail.c
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2017-09-04 14:09:19 +0200
committerBastien Nocera <hadess@hadess.net>2017-09-04 14:09:19 +0200
commit2d6ce46066ba7ba7baec3831978c74293f296829 (patch)
tree3c706db653473d719fdaafeee91c3986b2bd0ace /libgnome-desktop/gnome-desktop-thumbnail.c
parent6046de9d76e1748d1d35c58f25b5c75d9029ceff (diff)
downloadgnome-desktop-2d6ce46066ba7ba7baec3831978c74293f296829.tar.gz
thumbnail: Fix nautilus trying to thumbnail folders
And loads of other non-thumbnailable files in a regression introduced in 3b298f60. To answer _can_thumbnail() correctly, we need to check whether a thumbnailer exists for the mime-type in question, not simply assume it to be available. https://bugzilla.gnome.org/show_bug.cgi?id=785404
Diffstat (limited to 'libgnome-desktop/gnome-desktop-thumbnail.c')
-rw-r--r--libgnome-desktop/gnome-desktop-thumbnail.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libgnome-desktop/gnome-desktop-thumbnail.c b/libgnome-desktop/gnome-desktop-thumbnail.c
index c7ff6d5e..5d553494 100644
--- a/libgnome-desktop/gnome-desktop-thumbnail.c
+++ b/libgnome-desktop/gnome-desktop-thumbnail.c
@@ -919,7 +919,12 @@ gnome_desktop_thumbnail_factory_can_thumbnail (GnomeDesktopThumbnailFactory *fac
g_mutex_lock (&factory->priv->lock);
if (!gnome_desktop_thumbnail_factory_is_disabled (factory, mime_type))
- have_script = TRUE;
+ {
+ Thumbnailer *thumb;
+
+ thumb = g_hash_table_lookup (factory->priv->mime_types_map, mime_type);
+ have_script = (thumb != NULL);
+ }
g_mutex_unlock (&factory->priv->lock);
if (have_script)