[totem] grilo: Update for libgd API changes



commit 6e443f010a9515bccc0ea7fff9af410f6d924fc5
Author: Bastien Nocera <hadess hadess net>
Date:   Tue Jan 14 17:08:42 2014 +0100

    grilo: Update for libgd API changes

 src/plugins/grilo/grilo.ui             |    4 ++++
 src/plugins/grilo/totem-search-entry.c |   16 ++++++++--------
 2 files changed, 12 insertions(+), 8 deletions(-)
---
diff --git a/src/plugins/grilo/grilo.ui b/src/plugins/grilo/grilo.ui
index 1bc0687..4047a9f 100644
--- a/src/plugins/grilo/grilo.ui
+++ b/src/plugins/grilo/grilo.ui
@@ -33,6 +33,8 @@
       <column type="gchararray"/>
       <!-- column-name selected -->
       <column type="gboolean"/>
+      <!-- column-name pulse -->
+      <column type="guint"/>
 
       <!-- column-name source -->
       <column type="GObject"/>
@@ -132,6 +134,8 @@
       <column type="gchararray"/>
       <!-- column-name selected -->
       <column type="gboolean"/>
+      <!-- column-name pulse -->
+      <column type="guint"/>
 
       <!-- column-name source -->
       <column type="GObject"/>
diff --git a/src/plugins/grilo/totem-search-entry.c b/src/plugins/grilo/totem-search-entry.c
index 3deea24..fc3256d 100644
--- a/src/plugins/grilo/totem-search-entry.c
+++ b/src/plugins/grilo/totem-search-entry.c
@@ -24,9 +24,6 @@
 
 G_DEFINE_TYPE (TotemSearchEntry, totem_search_entry, GTK_TYPE_BOX)
 
-/* To be used as the ID in the GdTaggedEntry */
-#define SOURCE_ID "source-id"
-
 enum {
        SIGNAL_ACTIVATE,
        LAST_SIGNAL
@@ -44,6 +41,7 @@ struct _TotemSearchEntryPrivate {
        GtkWidget *button;
        GtkWidget *menu;
        GSList *group;
+       GdTaggedEntryTag *tag;
 };
 
 static void
@@ -51,6 +49,7 @@ totem_search_entry_finalize (GObject *obj)
 {
        TotemSearchEntry *self = TOTEM_SEARCH_ENTRY (obj);
 
+       g_clear_object (&self->priv->tag);
        g_clear_pointer (&self->priv->group, g_slist_free);
 
        G_OBJECT_CLASS (totem_search_entry_parent_class)->finalize (obj);
@@ -172,8 +171,7 @@ item_toggled (GtkCheckMenuItem *item,
 
        if (gtk_check_menu_item_get_active (item)) {
                label = g_object_get_data (G_OBJECT (item), "label");
-               gd_tagged_entry_set_tag_label (GD_TAGGED_ENTRY (self->priv->entry),
-                                              SOURCE_ID, label);
+               gd_tagged_entry_tag_set_label (self->priv->tag, label);
                g_object_notify (G_OBJECT (self), "selected-id");
        }
 }
@@ -202,8 +200,9 @@ totem_search_entry_add_source (TotemSearchEntry *self,
                self->priv->menu = gtk_menu_new ();
                gtk_menu_button_set_popup (GTK_MENU_BUTTON (self->priv->button),
                                           self->priv->menu);
-               gd_tagged_entry_add_tag (GD_TAGGED_ENTRY (self->priv->entry),
-                                        SOURCE_ID, label);
+               self->priv->tag = gd_tagged_entry_tag_new (label);
+               gd_tagged_entry_tag_set_has_close_button (self->priv->tag, FALSE);
+               gd_tagged_entry_insert_tag (GD_TAGGED_ENTRY (self->priv->entry), self->priv->tag, -1);
        }
 
        item = gtk_radio_menu_item_new_with_label (self->priv->group, label);
@@ -237,7 +236,8 @@ totem_search_entry_remove_source (TotemSearchEntry *self,
        if (num_items == 0) {
                gtk_menu_button_set_popup (GTK_MENU_BUTTON (self->priv->button), NULL);
                g_clear_object (&self->priv->menu);
-               gd_tagged_entry_remove_tag (GD_TAGGED_ENTRY (self->priv->entry), SOURCE_ID);
+               gd_tagged_entry_remove_tag (GD_TAGGED_ENTRY (self->priv->entry), self->priv->tag);
+               g_clear_object (&self->priv->tag);
        }
 }
 


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