[empathy/gnome-2-34] Bug 637097 — Port to latest folks API changes



commit 1450f98d3cde8ff3dc162eb01de670b2d314138e
Author: Philip Withnall <philip withnall collabora co uk>
Date:   Sun Dec 12 18:51:07 2010 +0000

    Bug 637097 â?? Port to latest folks API changes
    
    Catch up with three interface renamings which have happened in folks master.
    This bumps Empathy's folks dependency to 0.3.3. Closes: bgo#637097

 configure.ac                               |    4 ++--
 libempathy-gtk/empathy-contact-widget.c    |   10 +++++-----
 libempathy-gtk/empathy-individual-menu.c   |    4 ++--
 libempathy-gtk/empathy-individual-store.c  |    4 ++--
 libempathy-gtk/empathy-individual-view.c   |    6 +++---
 libempathy-gtk/empathy-individual-widget.c |    9 +++++----
 libempathy-gtk/empathy-persona-store.c     |    6 ++++--
 libempathy/empathy-individual-manager.c    |    4 ++--
 8 files changed, 25 insertions(+), 22 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index aef0ed5..529879a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -31,9 +31,9 @@ AC_COPYRIGHT([
 # Minimal version required
 
 # Hardp deps
-FOLKS_REQUIRED=0.1.15
+FOLKS_REQUIRED=0.3.4
 GCONF_REQUIRED=1.2.0
-GLIB_REQUIRED=2.25.9
+GLIB_REQUIRED=2.27.2
 GNUTLS_REQUIRED=2.8.5
 GTK_REQUIRED=2.22.0
 KEYRING_REQUIRED=2.26.0
diff --git a/libempathy-gtk/empathy-contact-widget.c b/libempathy-gtk/empathy-contact-widget.c
index 45c118d..0159e88 100644
--- a/libempathy-gtk/empathy-contact-widget.c
+++ b/libempathy-gtk/empathy-contact-widget.c
@@ -1284,10 +1284,10 @@ contact_widget_contact_update (EmpathyContactWidget *information)
           FolksPersona *persona = empathy_contact_get_persona (
               information->contact);
 
-          if (persona != NULL && FOLKS_IS_FAVOURITE (persona))
+          if (persona != NULL && FOLKS_IS_FAVOURITABLE (persona))
             {
-              gboolean is_favourite = folks_favourite_get_is_favourite (
-                  FOLKS_FAVOURITE (persona));
+              gboolean is_favourite = folks_favouritable_get_is_favourite (
+                  FOLKS_FAVOURITABLE (persona));
               contact_widget_favourites_changed_cb (information->manager,
                   information->contact, is_favourite, information);
             }
@@ -1418,10 +1418,10 @@ favourite_toggled_cb (GtkToggleButton *button,
 {
   FolksPersona *persona = empathy_contact_get_persona (information->contact);
 
-  if (persona != NULL && FOLKS_IS_FAVOURITE (persona))
+  if (persona != NULL && FOLKS_IS_FAVOURITABLE (persona))
     {
       gboolean active = gtk_toggle_button_get_active (button);
-      folks_favourite_set_is_favourite (FOLKS_FAVOURITE (persona), active);
+      folks_favouritable_set_is_favourite (FOLKS_FAVOURITABLE (persona), active);
     }
 }
 
diff --git a/libempathy-gtk/empathy-individual-menu.c b/libempathy-gtk/empathy-individual-menu.c
index b1237cf..d90e57e 100644
--- a/libempathy-gtk/empathy-individual-menu.c
+++ b/libempathy-gtk/empathy-individual-menu.c
@@ -749,7 +749,7 @@ static void
 favourite_menu_item_toggled_cb (GtkCheckMenuItem *item,
   FolksIndividual *individual)
 {
-  folks_favourite_set_is_favourite (FOLKS_FAVOURITE (individual),
+  folks_favouritable_set_is_favourite (FOLKS_FAVOURITABLE (individual),
       gtk_check_menu_item_get_active (item));
 }
 
@@ -761,7 +761,7 @@ empathy_individual_favourite_menu_item_new (FolksIndividual *individual)
   item = gtk_check_menu_item_new_with_label (_("Favorite"));
 
   gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item),
-      folks_favourite_get_is_favourite (FOLKS_FAVOURITE (individual)));
+      folks_favouritable_get_is_favourite (FOLKS_FAVOURITABLE (individual)));
 
   g_signal_connect (item, "toggled",
       G_CALLBACK (favourite_menu_item_toggled_cb), individual);
diff --git a/libempathy-gtk/empathy-individual-store.c b/libempathy-gtk/empathy-individual-store.c
index 9d8569c..6ab52e8 100644
--- a/libempathy-gtk/empathy-individual-store.c
+++ b/libempathy-gtk/empathy-individual-store.c
@@ -445,7 +445,7 @@ individual_store_add_individual (EmpathyIndividualStore *self,
   g_list_free (groups);
 
   if (priv->show_groups &&
-      folks_favourite_get_is_favourite (FOLKS_FAVOURITE (individual)))
+      folks_favouritable_get_is_favourite (FOLKS_FAVOURITABLE (individual)))
     {
       /* Add contact to the fake 'Favorites' group */
       GtkTreeIter iter_group;
@@ -673,7 +673,7 @@ individual_store_contact_update (EmpathyIndividualStore *self,
     }
 
   /* Get online state now. */
-  now_online = folks_individual_is_online (individual);
+  now_online = folks_has_presence_is_online (FOLKS_HAS_PRESENCE (individual));
 
   if (!in_list)
     {
diff --git a/libempathy-gtk/empathy-individual-view.c b/libempathy-gtk/empathy-individual-view.c
index 9e18dca..4c13e78 100644
--- a/libempathy-gtk/empathy-individual-view.c
+++ b/libempathy-gtk/empathy-individual-view.c
@@ -370,14 +370,14 @@ real_drag_individual_received_cb (EmpathyIndividualView *self,
   if (!tp_strdiff (new_group, EMPATHY_INDIVIDUAL_STORE_FAVORITE))
     {
       /* Mark contact as favourite */
-      folks_favourite_set_is_favourite (FOLKS_FAVOURITE (individual), TRUE);
+      folks_favouritable_set_is_favourite (FOLKS_FAVOURITABLE (individual), TRUE);
       return;
     }
 
   if (!tp_strdiff (old_group, EMPATHY_INDIVIDUAL_STORE_FAVORITE))
     {
       /* Remove contact as favourite */
-      folks_favourite_set_is_favourite (FOLKS_FAVOURITE (individual), FALSE);
+      folks_favouritable_set_is_favourite (FOLKS_FAVOURITABLE (individual), FALSE);
 
       /* Don't try to remove it */
       old_group = NULL;
@@ -624,7 +624,7 @@ individual_view_drag_motion (GtkWidget *widget,
         }
 
       if (individual != NULL &&
-          folks_individual_is_online (individual) &&
+          folks_has_presence_is_online (FOLKS_HAS_PRESENCE (individual)) &&
           (caps & EMPATHY_CAPABILITIES_FT))
         {
           gdk_drag_status (context, GDK_ACTION_COPY, time_);
diff --git a/libempathy-gtk/empathy-individual-widget.c b/libempathy-gtk/empathy-individual-widget.c
index 0667587..41e4110 100644
--- a/libempathy-gtk/empathy-individual-widget.c
+++ b/libempathy-gtk/empathy-individual-widget.c
@@ -816,7 +816,7 @@ individual_dup_avatar (FolksIndividual *individual)
 
   /* FIXME: We just choose the first Persona which has an avatar, and save that.
    * The avatar handling in EmpathyContact needs to be moved into libfolks as
-   * much as possible, and this code rewritten to use FolksAvatar.
+   * much as possible, and this code rewritten to use FolksHasAvatar.
    * (bgo#627401) */
   personas = folks_individual_get_personas (individual);
   for (l = personas; l != NULL; l = l->next)
@@ -1070,8 +1070,8 @@ favourite_toggled_cb (GtkToggleButton *button,
     EmpathyIndividualWidget *self)
 {
   gboolean active = gtk_toggle_button_get_active (button);
-  folks_favourite_set_is_favourite (
-      FOLKS_FAVOURITE (GET_PRIV (self)->individual), active);
+  folks_favouritable_set_is_favourite (
+      FOLKS_FAVOURITABLE (GET_PRIV (self)->individual), active);
 }
 
 static void
@@ -1210,7 +1210,8 @@ notify_is_favourite_cb (gpointer folks_object,
   if (GTK_IS_TOGGLE_BUTTON (favourite_widget))
     {
       gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (favourite_widget),
-          folks_favourite_get_is_favourite (FOLKS_FAVOURITE (folks_object)));
+          folks_favouritable_get_is_favourite (
+              FOLKS_FAVOURITABLE (folks_object)));
     }
 }
 
diff --git a/libempathy-gtk/empathy-persona-store.c b/libempathy-gtk/empathy-persona-store.c
index fbeeb69..a09a3e4 100644
--- a/libempathy-gtk/empathy-persona-store.c
+++ b/libempathy-gtk/empathy-persona-store.c
@@ -484,9 +484,11 @@ update_persona (EmpathyPersonaStore *self,
           EMPATHY_PERSONA_STORE_COL_DISPLAY_ID,
               folks_persona_get_display_id (persona),
           EMPATHY_PERSONA_STORE_COL_PRESENCE_TYPE,
-              folks_presence_get_presence_type (FOLKS_PRESENCE (persona)),
+              folks_has_presence_get_presence_type (
+                  FOLKS_HAS_PRESENCE (persona)),
           EMPATHY_PERSONA_STORE_COL_STATUS,
-              folks_presence_get_presence_message (FOLKS_PRESENCE (persona)),
+              folks_has_presence_get_presence_message (
+                  FOLKS_HAS_PRESENCE (persona)),
           EMPATHY_PERSONA_STORE_COL_IS_ONLINE, now_online,
           EMPATHY_PERSONA_STORE_COL_CAN_AUDIO_CALL,
               empathy_contact_get_capabilities (contact) &
diff --git a/libempathy/empathy-individual-manager.c b/libempathy/empathy-individual-manager.c
index 7411fce..fa5bd38 100644
--- a/libempathy/empathy-individual-manager.c
+++ b/libempathy/empathy-individual-manager.c
@@ -85,8 +85,8 @@ individual_notify_is_favourite_cb (FolksIndividual *individual,
     GParamSpec *pspec,
     EmpathyIndividualManager *self)
 {
-  gboolean is_favourite = folks_favourite_get_is_favourite (
-      FOLKS_FAVOURITE (individual));
+  gboolean is_favourite = folks_favouritable_get_is_favourite (
+      FOLKS_FAVOURITABLE (individual));
   g_signal_emit (self, signals[FAVOURITES_CHANGED], 0, individual,
       is_favourite);
 }



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