[totem] grilo: Fix fallback icon for sources



commit 21e6abfcb9c99bff6aa099e18c9413c96751e392
Author: Bastien Nocera <hadess hadess net>
Date:   Tue Jan 21 19:36:09 2014 +0100

    grilo: Fix fallback icon for sources
    
    When we fail to get the icon set for sources, make sure to use the
    "box" icon, not the video one. Freebox' UPnP server points to a
    non-existant file.

 src/plugins/grilo/totem-grilo.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/src/plugins/grilo/totem-grilo.c b/src/plugins/grilo/totem-grilo.c
index 769fcf9..faf19a8 100644
--- a/src/plugins/grilo/totem-grilo.c
+++ b/src/plugins/grilo/totem-grilo.c
@@ -188,6 +188,7 @@ get_thumbnail_cb (GObject *source_object,
        SetThumbnailData *thumb_data = (SetThumbnailData *) user_data;
        GtkTreePath *path;
        GdkPixbuf *thumbnail;
+       const GdkPixbuf *fallback_thumbnail;
        GtkTreeModel *view_model;
        GError *error = NULL;
 
@@ -198,9 +199,16 @@ get_thumbnail_cb (GObject *source_object,
        path = gtk_tree_row_reference_get_path (thumb_data->reference);
        gtk_tree_model_get_iter (thumb_data->model, &iter, path);
 
+       if (thumbnail == NULL) {
+               if (thumb_data->media)
+                       fallback_thumbnail = totem_grilo_get_video_icon ();
+               else
+                       fallback_thumbnail = totem_grilo_get_box_icon ();
+       }
+
        gtk_tree_store_set (GTK_TREE_STORE (thumb_data->model),
                            &iter,
-                           GD_MAIN_COLUMN_ICON, thumbnail ? thumbnail : totem_grilo_get_video_icon (),
+                           GD_MAIN_COLUMN_ICON, thumbnail ? thumbnail : fallback_thumbnail,
                            -1);
        g_clear_object (&thumbnail);
 


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