[gnome-desktop] thumbnail: Fix nautilus trying to thumbnail folders



commit 2d6ce46066ba7ba7baec3831978c74293f296829
Author: Bastien Nocera <hadess hadess net>
Date:   Mon Sep 4 14:09:19 2017 +0200

    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

 libgnome-desktop/gnome-desktop-thumbnail.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/libgnome-desktop/gnome-desktop-thumbnail.c b/libgnome-desktop/gnome-desktop-thumbnail.c
index c7ff6d5..5d55349 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)


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