]> git.0d.be Git - empathy.git/commitdiff
Bug 637097 — Port to latest folks API changes
authorPhilip Withnall <philip.withnall@collabora.co.uk>
Sun, 12 Dec 2010 18:51:07 +0000 (18:51 +0000)
committerPhilip Withnall <philip.withnall@collabora.co.uk>
Mon, 13 Dec 2010 16:58:50 +0000 (16:58 +0000)
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
libempathy-gtk/empathy-contact-widget.c
libempathy-gtk/empathy-individual-menu.c
libempathy-gtk/empathy-individual-store.c
libempathy-gtk/empathy-individual-view.c
libempathy-gtk/empathy-individual-widget.c
libempathy-gtk/empathy-persona-store.c
libempathy-gtk/empathy-ui-utils.c
libempathy/empathy-contact.c
libempathy/empathy-individual-manager.c

index 4ed8d9e24e755caff1105c99574dfafddebbd700..c3b23d6d4b6dd73c27f32664ae70ac99545a19b7 100644 (file)
@@ -31,7 +31,7 @@ AC_COPYRIGHT([
 # Minimal version required
 
 # Hardp deps
-FOLKS_REQUIRED=0.3.2
+FOLKS_REQUIRED=0.3.3
 GLIB_REQUIRED=2.27.2
 GNUTLS_REQUIRED=2.8.5
 GTK_REQUIRED=2.91.3
index 26713ebe421c34dbadf5f8f2f2b9dd00bba97bd1..3ebaa9deebd3343e38ad8541fc3cd910015c58c2 100644 (file)
@@ -1345,10 +1345,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);
             }
@@ -1479,10 +1479,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);
     }
 }
 
index e3159b401d7113e89c293e093fcc5771d2861152..29ead4fb0597a1a90ff77a542359a7992d107a5e 100644 (file)
@@ -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);
index 4b07131a60ac1691ce63cf3398ab01e08b306a7b..0add70ce3504aed3bb5cf813e62d03652c140e03 100644 (file)
@@ -164,20 +164,21 @@ individual_get_client_types (FolksIndividual *individual)
   personas = folks_individual_get_personas (individual);
   for (l = personas; l != NULL; l = l->next)
     {
-      FolksPresence *presence;
+      FolksHasPresence *presence;
 
-      /* We only want personas which implement FolksPresence */
-      if (!FOLKS_IS_PRESENCE (l->data))
+      /* We only want personas which implement FolksHasPresence */
+      if (!FOLKS_IS_HAS_PRESENCE (l->data))
         continue;
 
-      presence = FOLKS_PRESENCE (l->data);
+      presence = FOLKS_HAS_PRESENCE (l->data);
 
-      if (folks_presence_typecmp (folks_presence_get_presence_type (presence),
+      if (folks_has_presence_typecmp (
+              folks_has_presence_get_presence_type (presence),
               presence_type) > 0)
         {
           TpContact *tp_contact;
 
-          presence_type = folks_presence_get_presence_type (presence);
+          presence_type = folks_has_presence_get_presence_type (presence);
 
           tp_contact = tpf_persona_get_contact (TPF_PERSONA (l->data));
           types = tp_contact_get_client_types (tp_contact);
@@ -477,7 +478,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;
@@ -705,7 +706,7 @@ individual_store_contact_update (EmpathyIndividualStore *self,
     }
 
   /* Get online state now. */
-  now_online = folks_presence_is_online (FOLKS_PRESENCE (individual));
+  now_online = folks_has_presence_is_online (FOLKS_HAS_PRESENCE (individual));
 
   if (!in_list)
     {
@@ -795,9 +796,11 @@ individual_store_contact_update (EmpathyIndividualStore *self,
           EMPATHY_INDIVIDUAL_STORE_COL_NAME,
             folks_aliasable_get_alias (FOLKS_ALIASABLE (individual)),
           EMPATHY_INDIVIDUAL_STORE_COL_PRESENCE_TYPE,
-            folks_presence_get_presence_type (FOLKS_PRESENCE (individual)),
+            folks_has_presence_get_presence_type (
+                FOLKS_HAS_PRESENCE (individual)),
           EMPATHY_INDIVIDUAL_STORE_COL_STATUS,
-            folks_presence_get_presence_message (FOLKS_PRESENCE (individual)),
+            folks_has_presence_get_presence_message (
+                FOLKS_HAS_PRESENCE (individual)),
           EMPATHY_INDIVIDUAL_STORE_COL_COMPACT, priv->is_compact,
           EMPATHY_INDIVIDUAL_STORE_COL_IS_GROUP, FALSE,
           EMPATHY_INDIVIDUAL_STORE_COL_IS_ONLINE, now_online,
@@ -1464,9 +1467,9 @@ individual_store_state_sort_func (GtkTreeModel *model,
    * the presences.
    */
   folks_presence_type_a =
-      folks_presence_get_presence_type (FOLKS_PRESENCE (individual_a));
+      folks_has_presence_get_presence_type (FOLKS_HAS_PRESENCE (individual_a));
   folks_presence_type_b =
-      folks_presence_get_presence_type (FOLKS_PRESENCE (individual_b));
+      folks_has_presence_get_presence_type (FOLKS_HAS_PRESENCE (individual_b));
   tp_presence_a = empathy_folks_presence_type_to_tp (folks_presence_type_a);
   tp_presence_b = empathy_folks_presence_type_to_tp (folks_presence_type_b);
 
index ee2a3af854c52c846f01a2b454dd5feca8e4513c..30098e534bcb7137fd864545f02d0c79b00000ad 100644 (file)
@@ -377,14 +377,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;
@@ -681,7 +681,7 @@ individual_view_drag_motion (GtkWidget *widget,
         }
 
       if (individual != NULL &&
-          folks_presence_is_online (FOLKS_PRESENCE (individual)) &&
+          folks_has_presence_is_online (FOLKS_HAS_PRESENCE (individual)) &&
           (caps & EMPATHY_CAPABILITIES_FT))
         {
           gdk_drag_status (context, GDK_ACTION_COPY, time_);
index 138b70db92aa0d55f34f90ba0200b28e67ca171b..44e7f95726349b85b48bc4b472d2bad7f0fa696d 100644 (file)
@@ -220,19 +220,20 @@ update_weak_contact (EmpathyIndividualWidget *self)
       personas = folks_individual_get_personas (priv->individual);
       for (l = personas; l != NULL; l = l->next)
         {
-          FolksPresence *presence;
+          FolksHasPresence *presence;
 
           /* We only want personas which implement FolksPresence */
-          if (!FOLKS_IS_PRESENCE (l->data))
+          if (!FOLKS_IS_HAS_PRESENCE (l->data))
             continue;
 
-          presence = FOLKS_PRESENCE (l->data);
+          presence = FOLKS_HAS_PRESENCE (l->data);
 
-          if (folks_presence_typecmp (folks_presence_get_presence_type (presence),
+          if (folks_has_presence_typecmp (
+                  folks_has_presence_get_presence_type (presence),
                   presence_type) > 0
               && TPF_IS_PERSONA (presence))
             {
-              presence_type = folks_presence_get_presence_type (presence);
+              presence_type = folks_has_presence_get_presence_type (presence);
               tp_contact = tpf_persona_get_contact (TPF_PERSONA (l->data));
             }
         }
@@ -896,7 +897,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)
@@ -1150,8 +1151,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
@@ -1247,11 +1248,13 @@ notify_presence_cb (gpointer folks_object,
   state_image = g_object_get_data (table, "state-image");
 
   /* FIXME: Default messages should be moved into libfolks (bgo#627403) */
-  message = folks_presence_get_presence_message (FOLKS_PRESENCE (folks_object));
+  message = folks_has_presence_get_presence_message (
+      FOLKS_HAS_PRESENCE (folks_object));
   if (EMP_STR_EMPTY (message))
     {
       message = empathy_presence_get_default_message (
-          folks_presence_get_presence_type (FOLKS_PRESENCE (folks_object)));
+          folks_has_presence_get_presence_type (
+              FOLKS_HAS_PRESENCE (folks_object)));
     }
 
   if (message != NULL)
@@ -1261,7 +1264,8 @@ notify_presence_cb (gpointer folks_object,
 
   gtk_image_set_from_icon_name (GTK_IMAGE (state_image),
       empathy_icon_name_for_presence (
-          folks_presence_get_presence_type (FOLKS_PRESENCE (folks_object))),
+          folks_has_presence_get_presence_type (
+              FOLKS_HAS_PRESENCE (folks_object))),
       GTK_ICON_SIZE_BUTTON);
   gtk_widget_show (state_image);
 }
@@ -1290,7 +1294,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)));
     }
 }
 
index e3c24bab40c6b4a0310a4afa74dedb8219ee291c..b77e34d4b76f7770360dd04e3bfdc18bc1d325ec 100644 (file)
@@ -438,7 +438,7 @@ update_persona (EmpathyPersonaStore *self,
       gtk_tree_path_free (path);
 
       /* Get online state now. */
-      now_online = folks_presence_is_online (FOLKS_PRESENCE (persona));
+      now_online = folks_has_presence_is_online (FOLKS_HAS_PRESENCE (persona));
 
       /* Get online state before. */
       gtk_tree_model_get (GTK_TREE_MODEL (self), &iter,
@@ -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) &
@@ -626,8 +628,8 @@ state_sort_func (GtkTreeModel *model,
    * the presences.
    */
   ret_val = -tp_connection_presence_type_cmp_availability (
-      folks_presence_get_presence_type (FOLKS_PRESENCE (persona_a)),
-      folks_presence_get_presence_type (FOLKS_PRESENCE (persona_b)));
+      folks_has_presence_get_presence_type (FOLKS_HAS_PRESENCE (persona_a)),
+      folks_has_presence_get_presence_type (FOLKS_HAS_PRESENCE (persona_b)));
 
   if (ret_val == 0) {
     /* Fallback: compare by name et al. */
index 4c128742405b72274640e1b50b70b986c9594de2..043c03eb30d88b9e6e05c8ba523629ac84ac17c4 100644 (file)
@@ -232,7 +232,8 @@ empathy_icon_name_for_individual (FolksIndividual *individual)
        TpConnectionPresenceType presence;
 
        folks_presence =
-           folks_presence_get_presence_type (FOLKS_PRESENCE (individual));
+           folks_has_presence_get_presence_type (
+               FOLKS_HAS_PRESENCE (individual));
        presence = empathy_folks_presence_type_to_tp (folks_presence);
 
        return empathy_icon_name_for_presence (presence);
@@ -632,7 +633,8 @@ empathy_pixbuf_avatar_from_individual_scaled_async (
                        callback, user_data,
                        empathy_pixbuf_avatar_from_individual_scaled_async);
 
-       avatar_file = folks_avatar_get_avatar (FOLKS_AVATAR (individual));
+       avatar_file =
+               folks_has_avatar_get_avatar (FOLKS_HAS_AVATAR (individual));
        if (avatar_file == NULL)
                goto out;
 
index 5383187c1b07bce2ef8327b86b8a9cf7c49f6d0d..86bb9f5a87e3362bb6d78e56b5318a814c7470a4 100644 (file)
@@ -510,8 +510,8 @@ empathy_contact_set_presence_message (EmpathyContact *contact,
 
   if (priv->persona != NULL)
     {
-      folks_presence_set_presence_message (FOLKS_PRESENCE (priv->persona),
-          message);
+      folks_has_presence_set_presence_message (
+          FOLKS_HAS_PRESENCE (priv->persona), message);
     }
 }
 
@@ -991,7 +991,10 @@ empathy_contact_get_presence_message (EmpathyContact *contact)
   priv = GET_PRIV (contact);
 
   if (priv->persona != NULL)
-    return folks_presence_get_presence_message (FOLKS_PRESENCE (priv->persona));
+    {
+      return folks_has_presence_get_presence_message (
+          FOLKS_HAS_PRESENCE (priv->persona));
+    }
 
   return NULL;
 }
@@ -1791,15 +1794,16 @@ static int
 presence_cmp_func (EmpathyContact *a,
     EmpathyContact *b)
 {
-  FolksPresence *presence_a, *presence_b;
+  FolksHasPresence *presence_a, *presence_b;
 
-  presence_a = FOLKS_PRESENCE (empathy_contact_get_persona (a));
-  presence_b = FOLKS_PRESENCE (empathy_contact_get_persona (b));
+  presence_a = FOLKS_HAS_PRESENCE (empathy_contact_get_persona (a));
+  presence_b = FOLKS_HAS_PRESENCE (empathy_contact_get_persona (b));
 
   /* We negate the result because we're sorting in reverse order (i.e. such that
    * the Personas with the highest presence are at the beginning of the list. */
-  return -folks_presence_typecmp (folks_presence_get_presence_type (presence_a),
-      folks_presence_get_presence_type (presence_b));
+  return -folks_has_presence_typecmp (
+      folks_has_presence_get_presence_type (presence_a),
+      folks_has_presence_get_presence_type (presence_b));
 }
 
 static gint
index 82884e4d1f6e26003e5d5739afcf4261cc4556a0..29470b87e9a4f4eb556158a140e76fe05de38aa2 100644 (file)
@@ -82,8 +82,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);
 }