[empathy] Adjust for Folks Groupable -> GroupDetails rename



commit abf8b17d703c071f4fe91c09bac97c09314a2dc0
Author: Travis Reitter <travis reitter collabora co uk>
Date:   Thu Mar 10 22:01:09 2011 -0800

    Adjust for Folks Groupable -> GroupDetails rename
    
    Helps bgo#644470 - Empathy needs to catch up with Folks interface name change
    (API/ABI breaks)

 libempathy-gtk/empathy-contact-widget.c    |    6 +-
 libempathy-gtk/empathy-groups-widget.c     |  114 ++++++++++++++-------------
 libempathy-gtk/empathy-groups-widget.h     |    8 +-
 libempathy-gtk/empathy-individual-store.c  |    3 +-
 libempathy-gtk/empathy-individual-view.c   |   12 ++--
 libempathy-gtk/empathy-individual-widget.c |    4 +-
 libempathy/empathy-contact.c               |   13 ++--
 libempathy/empathy-individual-manager.c    |    8 +-
 libempathy/empathy-utils.c                 |    2 +-
 libempathy/empathy-utils.h                 |    2 +-
 10 files changed, 89 insertions(+), 83 deletions(-)
---
diff --git a/libempathy-gtk/empathy-contact-widget.c b/libempathy-gtk/empathy-contact-widget.c
index 204b168..15b8ed3 100644
--- a/libempathy-gtk/empathy-contact-widget.c
+++ b/libempathy-gtk/empathy-contact-widget.c
@@ -739,11 +739,11 @@ contact_widget_groups_update (EmpathyContactWidget *information)
       FolksPersona *persona =
           empathy_contact_get_persona (information->contact);
 
-      if (FOLKS_IS_GROUPABLE (persona))
+      if (FOLKS_IS_GROUP_DETAILS (persona))
         {
-          empathy_groups_widget_set_groupable (
+          empathy_groups_widget_set_group_details (
               EMPATHY_GROUPS_WIDGET (information->groups_widget),
-              FOLKS_GROUPABLE (persona));
+              FOLKS_GROUP_DETAILS (persona));
           gtk_widget_show (information->groups_widget);
 
           return;
diff --git a/libempathy-gtk/empathy-groups-widget.c b/libempathy-gtk/empathy-groups-widget.c
index f8a1847..fee9f8f 100644
--- a/libempathy-gtk/empathy-groups-widget.c
+++ b/libempathy-gtk/empathy-groups-widget.c
@@ -40,20 +40,20 @@
 /**
  * SECTION:empathy-groups-widget
  * @title:EmpathyGroupsWidget
- * @short_description: A widget used to edit the groups of a #FolksGroupable
+ * @short_description: A widget used to edit the groups of a #FolksGroupDetails
  * @include: libempathy-gtk/empathy-groups-widget.h
  *
- * #EmpathyGroupsWidget is a widget which lists the groups of a #FolksGroupable
- * (i.e. a #FolksPersona or a #FolksIndividual) and allows them to be added and
- * removed.
+ * #EmpathyGroupsWidget is a widget which lists the groups of a
+ * #FolksGroupDetails (i.e. a #FolksPersona or a #FolksIndividual) and allows
+ * them to be added and removed.
  */
 
 /**
  * EmpathyGroupsWidget:
  * @parent: parent object
  *
- * Widget which displays and allows editing of the groups of a #FolksGroupable
- * (i.e. a #FolksPersona or #FolksIndividual).
+ * Widget which displays and allows editing of the groups of a
+ * #FolksGroupDetails (i.e. a #FolksPersona or #FolksIndividual).
  */
 
 /* Delay before updating the widget when the id entry changed (seconds) */
@@ -64,7 +64,7 @@
 typedef struct
 {
   /* The object we're actually changing the groups of */
-  FolksGroupable *groupable; /* owned */
+  FolksGroupDetails *group_details; /* owned */
   GtkListStore *group_store; /* owned */
 
   GtkWidget *add_group_entry; /* child widget */
@@ -72,7 +72,7 @@ typedef struct
 } EmpathyGroupsWidgetPriv;
 
 enum {
-  PROP_GROUPABLE = 1,
+  PROP_GROUP_DETAILS = 1,
 };
 
 enum {
@@ -165,8 +165,8 @@ populate_data (EmpathyGroupsWidget *self)
       EMPATHY_CONTACT_LIST (manager));
   g_object_unref (manager);
 
-  /* Get the list of groups that this #FolksGroupable is currently in */
-  my_groups = folks_groupable_get_groups (priv->groupable);
+  /* Get the list of groups that this #FolksGroupDetails is currently in */
+  my_groups = folks_group_details_get_groups (priv->group_details);
 
   for (l = all_groups; l != NULL; l = l->next)
     {
@@ -217,13 +217,13 @@ add_group_entry_activate_cb (GtkEntry *entry,
 }
 
 static void
-change_group_cb (FolksGroupable *groupable,
+change_group_cb (FolksGroupDetails *group_details,
     GAsyncResult *async_result,
     EmpathyGroupsWidget *self)
 {
   GError *error = NULL;
 
-  folks_groupable_change_group_finish (groupable, async_result, &error);
+  folks_group_details_change_group_finish (group_details, async_result, &error);
 
   if (error != NULL)
     {
@@ -248,7 +248,7 @@ add_group_button_clicked_cb (GtkButton *button,
       COL_ENABLED, TRUE,
       -1);
 
-  folks_groupable_change_group (priv->groupable, group, TRUE,
+  folks_group_details_change_group (priv->group_details, group, TRUE,
       (GAsyncReadyCallback) change_group_cb, self);
 }
 
@@ -280,15 +280,15 @@ cell_toggled_cb (GtkCellRendererToggle *cell,
 
   if (group != NULL)
     {
-      folks_groupable_change_group (priv->groupable, group, !was_enabled,
-          (GAsyncReadyCallback) change_group_cb, self);
+      folks_group_details_change_group (priv->group_details, group,
+          !was_enabled, (GAsyncReadyCallback) change_group_cb, self);
       g_free (group);
     }
 }
 
 
 static void
-groupable_group_changed_cb (FolksGroupable *groups,
+group_details_group_changed_cb (FolksGroupDetails *groups,
     const gchar *group,
     gboolean is_member,
     EmpathyGroupsWidget *self)
@@ -453,8 +453,8 @@ get_property (GObject *object,
 
   switch (param_id)
     {
-      case PROP_GROUPABLE:
-        g_value_set_object (value, priv->groupable);
+      case PROP_GROUP_DETAILS:
+        g_value_set_object (value, priv->group_details);
         break;
       default:
         G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
@@ -474,8 +474,8 @@ set_property (GObject *object,
 
   switch (param_id)
     {
-      case PROP_GROUPABLE:
-        empathy_groups_widget_set_groupable (EMPATHY_GROUPS_WIDGET (object),
+      case PROP_GROUP_DETAILS:
+        empathy_groups_widget_set_group_details (EMPATHY_GROUPS_WIDGET (object),
             g_value_get_object (value));
         break;
       default:
@@ -489,7 +489,8 @@ dispose (GObject *object)
 {
   EmpathyGroupsWidgetPriv *priv = GET_PRIV (object);
 
-  empathy_groups_widget_set_groupable (EMPATHY_GROUPS_WIDGET (object), NULL);
+  empathy_groups_widget_set_group_details (EMPATHY_GROUPS_WIDGET (object),
+      NULL);
   tp_clear_object (&priv->group_store);
 
   G_OBJECT_CLASS (empathy_groups_widget_parent_class)->dispose (object);
@@ -505,16 +506,16 @@ empathy_groups_widget_class_init (EmpathyGroupsWidgetClass *klass)
   object_class->dispose = dispose;
 
   /**
-   * EmpathyGroupsWidget:groupable:
+   * EmpathyGroupsWidget:group_details:
    *
-   * The #FolksGroupable whose group membership is to be edited by the
+   * The #FolksGroupDetails whose group membership is to be edited by the
    * #EmpathyGroupsWidget.
    */
-  g_object_class_install_property (object_class, PROP_GROUPABLE,
-      g_param_spec_object ("groupable",
-          "Groupable",
-          "The #FolksGroupable whose groups are being edited.",
-          FOLKS_TYPE_GROUPABLE,
+  g_object_class_install_property (object_class, PROP_GROUP_DETAILS,
+      g_param_spec_object ("group-details",
+          "Group Details",
+          "The #FolksGroupDetails whose groups are being edited.",
+          FOLKS_TYPE_GROUP_DETAILS,
           G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
 
   g_type_class_add_private (object_class, sizeof (EmpathyGroupsWidgetPriv));
@@ -522,80 +523,83 @@ empathy_groups_widget_class_init (EmpathyGroupsWidgetClass *klass)
 
 /**
  * empathy_groups_widget_new:
- * @groupable: a #FolksGroupable, or %NULL
+ * @group_details: a #FolksGroupDetails, or %NULL
  *
  * Creates a new #EmpathyGroupsWidget to edit the groups of the given
- * @groupable.
+ * @group_details.
  *
  * Return value: a new #EmpathyGroupsWidget
  */
 GtkWidget *
-empathy_groups_widget_new (FolksGroupable *groupable)
+empathy_groups_widget_new (FolksGroupDetails *group_details)
 {
-  g_return_val_if_fail (groupable == NULL || FOLKS_IS_GROUPABLE (groupable),
+  g_return_val_if_fail (
+      group_details == NULL || FOLKS_IS_GROUP_DETAILS (group_details),
       NULL);
 
   return GTK_WIDGET (g_object_new (EMPATHY_TYPE_GROUPS_WIDGET,
-      "groupable", groupable,
+      "group-details", group_details,
       NULL));
 }
 
 /**
- * empathy_groups_widget_get_groupable:
+ * empathy_groups_widget_get_group_details:
  * @self: an #EmpathyGroupsWidget
  *
- * Get the #FolksGroupable whose group membership is being edited by the
+ * Get the #FolksGroupDetails whose group membership is being edited by the
  * #EmpathyGroupsWidget.
  *
- * Returns: the #FolksGroupable associated with @widget, or %NULL
+ * Returns: the #FolksGroupDetails associated with @widget, or %NULL
  */
-FolksGroupable *
-empathy_groups_widget_get_groupable (EmpathyGroupsWidget *self)
+FolksGroupDetails *
+empathy_groups_widget_get_group_details (EmpathyGroupsWidget *self)
 {
   g_return_val_if_fail (EMPATHY_IS_GROUPS_WIDGET (self), NULL);
 
-  return GET_PRIV (self)->groupable;
+  return GET_PRIV (self)->group_details;
 }
 
 /**
- * empathy_groups_widget_set_groupable:
+ * empathy_groups_widget_set_group_details:
  * @self: an #EmpathyGroupsWidget
- * @groupable: the #FolksGroupable whose membership is to be edited, or %NULL
+ * @group_details: the #FolksGroupDetails whose membership is to be edited, or
+ * %NULL
  *
- * Change the #FolksGroupable whose group membership is to be edited by the
+ * Change the #FolksGroupDetails whose group membership is to be edited by the
  * #EmpathyGroupsWidget.
  */
 void
-empathy_groups_widget_set_groupable (EmpathyGroupsWidget *self,
-    FolksGroupable *groupable)
+empathy_groups_widget_set_group_details (EmpathyGroupsWidget *self,
+    FolksGroupDetails *group_details)
 {
   EmpathyGroupsWidgetPriv *priv;
 
   g_return_if_fail (EMPATHY_IS_GROUPS_WIDGET (self));
-  g_return_if_fail (groupable == NULL || FOLKS_IS_GROUPABLE (groupable));
+  g_return_if_fail (
+      group_details == NULL || FOLKS_IS_GROUP_DETAILS (group_details));
 
   priv = GET_PRIV (self);
 
-  if (groupable == priv->groupable)
+  if (group_details == priv->group_details)
     return;
 
-  if (priv->groupable != NULL)
+  if (priv->group_details != NULL)
     {
-      g_signal_handlers_disconnect_by_func (priv->groupable,
-          groupable_group_changed_cb, self);
+      g_signal_handlers_disconnect_by_func (priv->group_details,
+          group_details_group_changed_cb, self);
     }
 
-  tp_clear_object (&priv->groupable);
+  tp_clear_object (&priv->group_details);
 
-  if (groupable != NULL)
+  if (group_details != NULL)
     {
-      priv->groupable = g_object_ref (groupable);
+      priv->group_details = g_object_ref (group_details);
 
-      g_signal_connect (priv->groupable, "group-changed",
-          (GCallback) groupable_group_changed_cb, self);
+      g_signal_connect (priv->group_details, "group-changed",
+          (GCallback) group_details_group_changed_cb, self);
 
       populate_data (self);
     }
 
-  g_object_notify (G_OBJECT (self), "groupable");
+  g_object_notify (G_OBJECT (self), "group-details");
 }
diff --git a/libempathy-gtk/empathy-groups-widget.h b/libempathy-gtk/empathy-groups-widget.h
index d747501..1085fac 100644
--- a/libempathy-gtk/empathy-groups-widget.h
+++ b/libempathy-gtk/empathy-groups-widget.h
@@ -54,12 +54,12 @@ typedef struct {
 
 GType empathy_groups_widget_get_type (void) G_GNUC_CONST;
 
-GtkWidget * empathy_groups_widget_new (FolksGroupable *groupable);
+GtkWidget * empathy_groups_widget_new (FolksGroupDetails *group_details);
 
-FolksGroupable * empathy_groups_widget_get_groupable (
+FolksGroupDetails * empathy_groups_widget_get_group_details (
     EmpathyGroupsWidget *self);
-void empathy_groups_widget_set_groupable (EmpathyGroupsWidget *self,
-    FolksGroupable *groupable);
+void empathy_groups_widget_set_group_details (EmpathyGroupsWidget *self,
+    FolksGroupDetails *group_details);
 
 G_END_DECLS
 
diff --git a/libempathy-gtk/empathy-individual-store.c b/libempathy-gtk/empathy-individual-store.c
index 244e183..95b41ca 100644
--- a/libempathy-gtk/empathy-individual-store.c
+++ b/libempathy-gtk/empathy-individual-store.c
@@ -428,7 +428,8 @@ individual_store_add_individual (EmpathyIndividualStore *self,
 
   if (priv->show_groups)
     {
-      group_set = folks_groupable_get_groups (FOLKS_GROUPABLE (individual));
+      group_set = folks_group_details_get_groups (
+          FOLKS_GROUP_DETAILS (individual));
       groups = g_hash_table_get_keys (group_set);
     }
 
diff --git a/libempathy-gtk/empathy-individual-view.c b/libempathy-gtk/empathy-individual-view.c
index a845b36..638b7d9 100644
--- a/libempathy-gtk/empathy-individual-view.c
+++ b/libempathy-gtk/empathy-individual-view.c
@@ -240,10 +240,10 @@ groups_change_group_cb (GObject *source,
     GAsyncResult *result,
     gpointer user_data)
 {
-  FolksGroupable *groupable = FOLKS_GROUPABLE (source);
+  FolksGroupDetails *group_details = FOLKS_GROUP_DETAILS (source);
   GError *error = NULL;
 
-  folks_groupable_change_group_finish (groupable, result, &error);
+  folks_group_details_change_group_finish (group_details, result, &error);
   if (error != NULL)
     {
       g_warning ("failed to change group: %s", error->message);
@@ -391,14 +391,14 @@ real_drag_individual_received_cb (EmpathyIndividualView *self,
 
   if (new_group != NULL)
     {
-      folks_groupable_change_group (FOLKS_GROUPABLE (individual), new_group, TRUE,
-          groups_change_group_cb, NULL);
+      folks_group_details_change_group (FOLKS_GROUP_DETAILS (individual),
+          new_group, TRUE, groups_change_group_cb, NULL);
     }
 
   if (old_group != NULL && action == GDK_ACTION_MOVE)
     {
-      folks_groupable_change_group (FOLKS_GROUPABLE (individual), old_group,
-          FALSE, groups_change_group_cb, NULL);
+      folks_group_details_change_group (FOLKS_GROUP_DETAILS (individual),
+          old_group, FALSE, groups_change_group_cb, NULL);
     }
 }
 
diff --git a/libempathy-gtk/empathy-individual-widget.c b/libempathy-gtk/empathy-individual-widget.c
index 8148af4..2f5d8fa 100644
--- a/libempathy-gtk/empathy-individual-widget.c
+++ b/libempathy-gtk/empathy-individual-widget.c
@@ -468,9 +468,9 @@ groups_update (EmpathyIndividualWidget *self)
   if (priv->flags & EMPATHY_INDIVIDUAL_WIDGET_EDIT_GROUPS &&
       priv->individual != NULL)
     {
-      empathy_groups_widget_set_groupable (
+      empathy_groups_widget_set_group_details (
           EMPATHY_GROUPS_WIDGET (priv->groups_widget),
-          FOLKS_GROUPABLE (priv->individual));
+          FOLKS_GROUP_DETAILS (priv->individual));
       gtk_widget_show (priv->groups_widget);
     }
   else
diff --git a/libempathy/empathy-contact.c b/libempathy/empathy-contact.c
index 3218e29..ad462b2 100644
--- a/libempathy/empathy-contact.c
+++ b/libempathy/empathy-contact.c
@@ -752,10 +752,10 @@ groups_change_group_cb (GObject *source,
     GAsyncResult *result,
     gpointer user_data)
 {
-  FolksGroupable *groupable = FOLKS_GROUPABLE (source);
+  FolksGroupDetails *group_details = FOLKS_GROUP_DETAILS (source);
   GError *error = NULL;
 
-  folks_groupable_change_group_finish (groupable, result, &error);
+  folks_group_details_change_group_finish (group_details, result, &error);
   if (error != NULL)
     {
       g_warning ("failed to change group: %s", error->message);
@@ -779,9 +779,9 @@ empathy_contact_change_group (EmpathyContact *contact, const gchar *group,
   persona = empathy_contact_get_persona (contact);
   if (persona != NULL)
     {
-      if (FOLKS_IS_GROUPABLE (persona))
-        folks_groupable_change_group (FOLKS_GROUPABLE (persona), group, is_member,
-          groups_change_group_cb, contact);
+      if (FOLKS_IS_GROUP_DETAILS (persona))
+        folks_group_details_change_group (FOLKS_GROUP_DETAILS (persona), group,
+            is_member, groups_change_group_cb, contact);
       return;
     }
 
@@ -944,7 +944,8 @@ empathy_contact_set_persona (EmpathyContact *contact,
   /* Set the persona's groups */
   if (priv->groups != NULL)
     {
-      folks_groupable_set_groups (FOLKS_GROUPABLE (persona), priv->groups);
+      folks_group_details_set_groups (FOLKS_GROUP_DETAILS (persona),
+          priv->groups);
       g_hash_table_destroy (priv->groups);
       priv->groups = NULL;
     }
diff --git a/libempathy/empathy-individual-manager.c b/libempathy/empathy-individual-manager.c
index 044a881..861cfa1 100644
--- a/libempathy/empathy-individual-manager.c
+++ b/libempathy/empathy-individual-manager.c
@@ -573,10 +573,10 @@ groups_change_group_cb (GObject *source,
     GAsyncResult *result,
     gpointer user_data)
 {
-  FolksGroupable *groupable = FOLKS_GROUPABLE (source);
+  FolksGroupDetails *group_details = FOLKS_GROUP_DETAILS (source);
   GError *error = NULL;
 
-  folks_groupable_change_group_finish (groupable, result, &error);
+  folks_group_details_change_group_finish (group_details, result, &error);
   if (error != NULL)
     {
       g_warning ("failed to change group: %s", error->message);
@@ -589,8 +589,8 @@ remove_group_cb (const gchar *id,
     FolksIndividual *individual,
     const gchar *group)
 {
-  folks_groupable_change_group (FOLKS_GROUPABLE (individual), group, FALSE,
-      groups_change_group_cb, NULL);
+  folks_group_details_change_group (FOLKS_GROUP_DETAILS (individual), group,
+      FALSE, groups_change_group_cb, NULL);
 }
 
 void
diff --git a/libempathy/empathy-utils.c b/libempathy/empathy-utils.c
index 922c0d8..775a320 100644
--- a/libempathy/empathy-utils.c
+++ b/libempathy/empathy-utils.c
@@ -824,7 +824,7 @@ empathy_contact_dup_from_folks_individual (FolksIndividual *individual)
 
 TpChannelGroupChangeReason
 tp_channel_group_change_reason_from_folks_groups_change_reason (
-    FolksGroupableChangeReason reason)
+    FolksGroupDetailsChangeReason reason)
 {
   return (TpChannelGroupChangeReason) reason;
 }
diff --git a/libempathy/empathy-utils.h b/libempathy/empathy-utils.h
index 6e16f0a..de87902 100644
--- a/libempathy/empathy-utils.h
+++ b/libempathy/empathy-utils.h
@@ -108,7 +108,7 @@ void empathy_connect_new_account (TpAccount *account,
 TpConnectionPresenceType empathy_folks_presence_type_to_tp (FolksPresenceType type);
 gboolean empathy_folks_individual_contains_contact (FolksIndividual *individual);
 EmpathyContact * empathy_contact_dup_from_folks_individual (FolksIndividual *individual);
-TpChannelGroupChangeReason tp_channel_group_change_reason_from_folks_groups_change_reason (FolksGroupableChangeReason reason);
+TpChannelGroupChangeReason tp_channel_group_change_reason_from_folks_groups_change_reason (FolksGroupDetailsChangeReason reason);
 TpfPersonaStore * empathy_get_persona_store_for_connection (TpConnection *connection);
 gboolean empathy_connection_can_add_personas (TpConnection *connection);
 gboolean empathy_connection_can_alias_personas (TpConnection *connection);



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