[cheese] thumbview: don't return if theme_load_icon fails



commit d079e930bdcb22a27bc3de24ddf204db83486e15
Author: Filippo Argiolas <filippo argiolas gmail com>
Date:   Tue May 12 16:02:19 2009 +0200

    thumbview: don't return if theme_load_icon fails
    
    Don't return if "image-loading" icon is not found, we will have an empty
    pixbuf while the thumbnail thread is running but it is surely better than
    no thumbnail at all.
    Try to fallback to generic "image" icon before giving up.
    Fixes (at least it should) bug #582240.
---
 src/cheese-thumb-view.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/cheese-thumb-view.c b/src/cheese-thumb-view.c
index a912bfe..d60a52e 100644
--- a/src/cheese-thumb-view.c
+++ b/src/cheese-thumb-view.c
@@ -233,7 +233,11 @@ cheese_thumb_view_append_item (CheeseThumbView *thumb_view, GFile *file)
   else
   {
     icon_theme = gtk_icon_theme_get_default ();
-    pixbuf     = gtk_icon_theme_load_icon (icon_theme, "image-loading", 96, 0, &error);
+    pixbuf     = gtk_icon_theme_load_icon (icon_theme,
+                                           "image-loading",
+                                           96,
+                                           GTK_ICON_LOOKUP_GENERIC_FALLBACK,
+                                           &error);
   }
 
   if (!pixbuf)
@@ -241,7 +245,6 @@ cheese_thumb_view_append_item (CheeseThumbView *thumb_view, GFile *file)
     g_warning ("Couldn't load icon: %s", error->message);
     g_error_free (error);
     error = NULL;
-    return;
   }
 
   filename = g_file_get_path (file);
@@ -259,7 +262,7 @@ cheese_thumb_view_append_item (CheeseThumbView *thumb_view, GFile *file)
   gtk_icon_view_scroll_to_path (GTK_ICON_VIEW (thumb_view), path,
                                 TRUE, 1.0, 0.5);
 
-  g_object_unref (pixbuf);
+  if (pixbuf) g_object_unref (pixbuf);
 
   if (!priv->multiplex_thumbnail_generator)
   {



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