[totem] main: Add title parameter to totem_grilo_add_item_to_recent()



commit d9953fdfe2f691d4470559bc345284477369f8e9
Author: Bastien Nocera <hadess hadess net>
Date:   Fri Feb 14 18:45:05 2014 +0100

    main: Add title parameter to totem_grilo_add_item_to_recent()

 src/totem-grilo.c  |    8 ++++++++
 src/totem-grilo.h  |    1 +
 src/totem-object.c |    4 ++--
 3 files changed, 11 insertions(+), 2 deletions(-)
---
diff --git a/src/totem-grilo.c b/src/totem-grilo.c
index 8b8f185..5cb49b0 100644
--- a/src/totem-grilo.c
+++ b/src/totem-grilo.c
@@ -2302,6 +2302,7 @@ totem_grilo_get_current_page (TotemGrilo *self)
 gboolean
 totem_grilo_add_item_to_recent (TotemGrilo *self,
                                const char *uri,
+                               const char *title,
                                gboolean    is_web)
 {
        GrlMedia *media;
@@ -2314,6 +2315,11 @@ totem_grilo_add_item_to_recent (TotemGrilo *self,
        if (is_web) {
                char *basename;
 
+               /* This should only come from the
+                * "Open Location" dialogue, so it
+                * shouldn't have a title */
+               g_assert (title == NULL);
+
                media = grl_media_video_new ();
 
                basename = g_file_get_basename (file);
@@ -2330,6 +2336,8 @@ totem_grilo_add_item_to_recent (TotemGrilo *self,
                                               NULL,
                                               FALSE,
                                               options);
+               if (title)
+                       grl_media_set_title (media, title);
                g_object_unref (options);
        }
 
diff --git a/src/totem-grilo.h b/src/totem-grilo.h
index 2bfe99d..dcabc2d 100644
--- a/src/totem-grilo.h
+++ b/src/totem-grilo.h
@@ -72,6 +72,7 @@ void            totem_grilo_set_current_page      (TotemGrilo     *self,
 TotemGriloPage  totem_grilo_get_current_page      (TotemGrilo     *self);
 gboolean        totem_grilo_add_item_to_recent    (TotemGrilo     *self,
                                                    const char     *uri,
+                                                   const char     *title,
                                                    gboolean        is_web);
 
 G_END_DECLS
diff --git a/src/totem-object.c b/src/totem-object.c
index e196d28..df07101 100644
--- a/src/totem-object.c
+++ b/src/totem-object.c
@@ -1410,7 +1410,7 @@ totem_object_open_dialog (TotemObject *totem, const char *path)
        for (l = filenames; l != NULL; l = l->next) {
                char *uri = l->data;
 
-               totem_grilo_add_item_to_recent (TOTEM_GRILO (totem->grilo), uri, FALSE);
+               totem_grilo_add_item_to_recent (TOTEM_GRILO (totem->grilo), uri, NULL, FALSE);
                g_free (uri);
        }
        g_slist_free (filenames);
@@ -1591,7 +1591,7 @@ totem_open_location_response_cb (GtkDialog *dialog, gint response, TotemObject *
        uri = totem_open_location_get_uri (totem->open_location);
 
        if (uri != NULL) {
-               totem_grilo_add_item_to_recent (TOTEM_GRILO (totem->grilo), uri, TRUE);
+               totem_grilo_add_item_to_recent (TOTEM_GRILO (totem->grilo), uri, NULL, TRUE);
                g_free (uri);
        }
 


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