[totem] grilo: Add update_media() function



commit c5bb59c6992ca30e7498c83046579ac3d03edfc2
Author: Bastien Nocera <hadess hadess net>
Date:   Tue Jan 21 16:49:58 2014 +0100

    grilo: Add update_media() function
    
    Modelled after add_media_to_model()

 src/plugins/grilo/totem-grilo.c |   30 ++++++++++++++++++++++++++++++
 1 files changed, 30 insertions(+), 0 deletions(-)
---
diff --git a/src/plugins/grilo/totem-grilo.c b/src/plugins/grilo/totem-grilo.c
index f373b55..eba1e10 100644
--- a/src/plugins/grilo/totem-grilo.c
+++ b/src/plugins/grilo/totem-grilo.c
@@ -332,6 +332,36 @@ update_search_thumbnails (TotemGriloPlugin *self)
 }
 
 static void
+update_media (GtkTreeStore *model,
+             GtkTreeIter  *iter,
+             GrlSource    *source,
+             GrlMedia     *media)
+{
+       GdkPixbuf *thumbnail;
+       gboolean thumbnailing;
+       char *secondary;
+       GDateTime *mtime;
+
+       thumbnail = totem_grilo_get_icon (media, &thumbnailing);
+       secondary = get_secondary_text (media);
+       mtime = grl_media_get_modification_date (media);
+
+       gtk_tree_store_set (GTK_TREE_STORE (model), iter,
+                           MODEL_RESULTS_SOURCE, source,
+                           MODEL_RESULTS_CONTENT, media,
+                           GD_MAIN_COLUMN_ICON, thumbnail,
+                           MODEL_RESULTS_IS_PRETHUMBNAIL, thumbnailing,
+                           GD_MAIN_COLUMN_PRIMARY_TEXT, grl_media_get_title (media),
+                           GD_MAIN_COLUMN_SECONDARY_TEXT, secondary,
+                           GD_MAIN_COLUMN_MTIME, mtime ? g_date_time_to_unix (mtime) : 0,
+                           -1);
+
+       g_clear_object (&thumbnail);
+       g_free (secondary);
+       g_clear_pointer (&mtime, g_date_time_unref);
+}
+
+static void
 add_media_to_model (GtkTreeStore *model,
                    GtkTreeIter  *parent,
                    GrlSource    *source,


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