[totem] main: Add totem_object_add_to_view() for plugins



commit 080991e6f5e8f4ae586c3681188c85ca12a0f718
Author: Bastien Nocera <hadess hadess net>
Date:   Fri Feb 14 18:48:51 2014 +0100

    main: Add totem_object_add_to_view() for plugins

 src/totem-object.c |   24 ++++++++++++++++++++++++
 src/totem.h        |    5 +++++
 2 files changed, 29 insertions(+), 0 deletions(-)
---
diff --git a/src/totem-object.c b/src/totem-object.c
index df07101..5e350fe 100644
--- a/src/totem-object.c
+++ b/src/totem-object.c
@@ -815,6 +815,30 @@ totem_object_get_short_title (TotemObject *totem)
 }
 
 /**
+ * totem_object_add_to_view:
+ * @totem: a #TotemObject
+ * @file: a #GFile representing a media
+ * @title: a title for the media, or %NULL
+ *
+ * Adds a local media file to the main view.
+ *
+ **/
+void
+totem_object_add_to_view (TotemObject *totem,
+                         GFile       *file,
+                         const char  *title)
+{
+       char *uri;
+
+       uri = g_file_get_uri (file);
+       if (!totem_grilo_add_item_to_recent (TOTEM_GRILO (totem->grilo),
+                                            uri, title, FALSE)) {
+               g_warning ("Failed to add '%s' to view", uri);
+       }
+       g_free (uri);
+}
+
+/**
  * totem_object_set_current_subtitle:
  * @totem: a #TotemObject
  * @subtitle_uri: the URI of the subtitle file to add
diff --git a/src/totem.h b/src/totem.h
index d9308c1..385bc56 100644
--- a/src/totem.h
+++ b/src/totem.h
@@ -194,6 +194,11 @@ void totem_object_empty_menu_section               (TotemObject *totem,
 
 GtkWidget *totem_object_get_video_widget       (TotemObject *totem);
 
+/* Database handling */
+void   totem_object_add_to_view                (TotemObject *totem,
+                                                GFile       *file,
+                                                const char  *title);
+
 /* Current media information */
 char * totem_object_get_short_title            (TotemObject *totem);
 gint64 totem_object_get_current_time           (TotemObject *totem);


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