]> git.0d.be Git - empathy.git/commitdiff
Port Empathy to use FolksAliasable and FolksGroupable
authorPhilip Withnall <philip.withnall@collabora.co.uk>
Wed, 15 Sep 2010 14:23:14 +0000 (15:23 +0100)
committerTravis Reitter <travis.reitter@collabora.co.uk>
Mon, 4 Oct 2010 16:02:09 +0000 (09:02 -0700)
FolksAliasable is the new name for FolksAlias, and FolksGroupable
is the new name for FolksGroups.

configure.ac
libempathy-gtk/empathy-contact-widget.c
libempathy-gtk/empathy-groups-widget.c
libempathy-gtk/empathy-groups-widget.h
libempathy-gtk/empathy-individual-view.c
libempathy-gtk/empathy-individual-widget.c
libempathy-gtk/empathy-persona-store.c
libempathy/empathy-contact.c
libempathy/empathy-individual-manager.c
libempathy/empathy-utils.c
libempathy/empathy-utils.h

index 7abcf0f11859f52620574003d5f93d0095e96981..8b498d97d4cfede99799d696d8d3d165db4d704b 100644 (file)
@@ -31,7 +31,7 @@ AC_COPYRIGHT([
 # Minimal version required
 
 # Hardp deps
-FOLKS_REQUIRED=0.1.15
+FOLKS_REQUIRED=0.3.0
 GCONF_REQUIRED=1.2.0
 GLIB_REQUIRED=2.25.9
 GNUTLS_REQUIRED=2.8.5
index eaacc631656ca207d776a872aa588695cf6e8377..4701abedebda7e262b84e6ecbb63a3f732b090fb 100644 (file)
@@ -585,11 +585,11 @@ contact_widget_groups_update (EmpathyContactWidget *information)
       FolksPersona *persona =
           empathy_contact_get_persona (information->contact);
 
-      if (FOLKS_IS_GROUPS (persona))
+      if (FOLKS_IS_GROUPABLE (persona))
         {
           empathy_groups_widget_set_groupable (
               EMPATHY_GROUPS_WIDGET (information->groups_widget),
-              FOLKS_GROUPS (persona));
+              FOLKS_GROUPABLE (persona));
           gtk_widget_show (information->groups_widget);
 
           return;
index 8d878b7d362e28d126c6d4fc0bbcc66ce8aedea5..f8a1847d105a8989ed95c4a90dfa40ce201c5b27 100644 (file)
 /**
  * SECTION:empathy-groups-widget
  * @title:EmpathyGroupsWidget
- * @short_description: A widget used to edit the groups of a #FolksGroups
+ * @short_description: A widget used to edit the groups of a #FolksGroupable
  * @include: libempathy-gtk/empathy-groups-widget.h
  *
- * #EmpathyGroupsWidget is a widget which lists the groups of a #FolksGroups
+ * #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.
  */
@@ -52,7 +52,7 @@
  * EmpathyGroupsWidget:
  * @parent: parent object
  *
- * Widget which displays and allows editing of the groups of a #FolksGroups
+ * Widget which displays and allows editing of the groups of a #FolksGroupable
  * (i.e. a #FolksPersona or #FolksIndividual).
  */
 
@@ -64,7 +64,7 @@
 typedef struct
 {
   /* The object we're actually changing the groups of */
-  FolksGroups *groupable; /* owned */
+  FolksGroupable *groupable; /* owned */
   GtkListStore *group_store; /* owned */
 
   GtkWidget *add_group_entry; /* child widget */
@@ -165,8 +165,8 @@ populate_data (EmpathyGroupsWidget *self)
       EMPATHY_CONTACT_LIST (manager));
   g_object_unref (manager);
 
-  /* Get the list of groups that this #FolksGroups is currently in */
-  my_groups = folks_groups_get_groups (priv->groupable);
+  /* Get the list of groups that this #FolksGroupable is currently in */
+  my_groups = folks_groupable_get_groups (priv->groupable);
 
   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 (FolksGroups *groupable,
+change_group_cb (FolksGroupable *groupable,
     GAsyncResult *async_result,
     EmpathyGroupsWidget *self)
 {
   GError *error = NULL;
 
-  folks_groups_change_group_finish (groupable, async_result, &error);
+  folks_groupable_change_group_finish (groupable, async_result, &error);
 
   if (error != NULL)
     {
@@ -248,7 +248,7 @@ add_group_button_clicked_cb (GtkButton *button,
       COL_ENABLED, TRUE,
       -1);
 
-  folks_groups_change_group (priv->groupable, group, TRUE,
+  folks_groupable_change_group (priv->groupable, group, TRUE,
       (GAsyncReadyCallback) change_group_cb, self);
 }
 
@@ -280,7 +280,7 @@ cell_toggled_cb (GtkCellRendererToggle *cell,
 
   if (group != NULL)
     {
-      folks_groups_change_group (priv->groupable, group, !was_enabled,
+      folks_groupable_change_group (priv->groupable, group, !was_enabled,
           (GAsyncReadyCallback) change_group_cb, self);
       g_free (group);
     }
@@ -288,7 +288,7 @@ cell_toggled_cb (GtkCellRendererToggle *cell,
 
 
 static void
-groupable_group_changed_cb (FolksGroups *groups,
+groupable_group_changed_cb (FolksGroupable *groups,
     const gchar *group,
     gboolean is_member,
     EmpathyGroupsWidget *self)
@@ -507,14 +507,14 @@ empathy_groups_widget_class_init (EmpathyGroupsWidgetClass *klass)
   /**
    * EmpathyGroupsWidget:groupable:
    *
-   * The #FolksGroups whose group membership is to be edited by the
+   * The #FolksGroupable 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 #FolksGroups whose groups are being edited.",
-          FOLKS_TYPE_GROUPS,
+          "The #FolksGroupable whose groups are being edited.",
+          FOLKS_TYPE_GROUPABLE,
           G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
 
   g_type_class_add_private (object_class, sizeof (EmpathyGroupsWidgetPriv));
@@ -522,7 +522,7 @@ empathy_groups_widget_class_init (EmpathyGroupsWidgetClass *klass)
 
 /**
  * empathy_groups_widget_new:
- * @groupable: a #FolksGroups, or %NULL
+ * @groupable: a #FolksGroupable, or %NULL
  *
  * Creates a new #EmpathyGroupsWidget to edit the groups of the given
  * @groupable.
@@ -530,9 +530,9 @@ empathy_groups_widget_class_init (EmpathyGroupsWidgetClass *klass)
  * Return value: a new #EmpathyGroupsWidget
  */
 GtkWidget *
-empathy_groups_widget_new (FolksGroups *groupable)
+empathy_groups_widget_new (FolksGroupable *groupable)
 {
-  g_return_val_if_fail (groupable == NULL || FOLKS_IS_GROUPS (groupable),
+  g_return_val_if_fail (groupable == NULL || FOLKS_IS_GROUPABLE (groupable),
       NULL);
 
   return GTK_WIDGET (g_object_new (EMPATHY_TYPE_GROUPS_WIDGET,
@@ -544,12 +544,12 @@ empathy_groups_widget_new (FolksGroups *groupable)
  * empathy_groups_widget_get_groupable:
  * @self: an #EmpathyGroupsWidget
  *
- * Get the #FolksGroups whose group membership is being edited by the
+ * Get the #FolksGroupable whose group membership is being edited by the
  * #EmpathyGroupsWidget.
  *
- * Returns: the #FolksGroups associated with @widget, or %NULL
+ * Returns: the #FolksGroupable associated with @widget, or %NULL
  */
-FolksGroups *
+FolksGroupable *
 empathy_groups_widget_get_groupable (EmpathyGroupsWidget *self)
 {
   g_return_val_if_fail (EMPATHY_IS_GROUPS_WIDGET (self), NULL);
@@ -560,19 +560,19 @@ empathy_groups_widget_get_groupable (EmpathyGroupsWidget *self)
 /**
  * empathy_groups_widget_set_groupable:
  * @self: an #EmpathyGroupsWidget
- * @groupable: the #FolksGroups whose membership is to be edited, or %NULL
+ * @groupable: the #FolksGroupable whose membership is to be edited, or %NULL
  *
- * Change the #FolksGroups whose group membership is to be edited by the
+ * Change the #FolksGroupable whose group membership is to be edited by the
  * #EmpathyGroupsWidget.
  */
 void
 empathy_groups_widget_set_groupable (EmpathyGroupsWidget *self,
-    FolksGroups *groupable)
+    FolksGroupable *groupable)
 {
   EmpathyGroupsWidgetPriv *priv;
 
   g_return_if_fail (EMPATHY_IS_GROUPS_WIDGET (self));
-  g_return_if_fail (groupable == NULL || FOLKS_IS_GROUPS (groupable));
+  g_return_if_fail (groupable == NULL || FOLKS_IS_GROUPABLE (groupable));
 
   priv = GET_PRIV (self);
 
index 120d45e7e0c5e6cc78db7ebcd613d2427f89e964..d74750194a1f94227ba2eff0b38873f9ac4c3fcf 100644 (file)
@@ -54,12 +54,12 @@ typedef struct {
 
 GType empathy_groups_widget_get_type (void) G_GNUC_CONST;
 
-GtkWidget * empathy_groups_widget_new (FolksGroups *groupable);
+GtkWidget * empathy_groups_widget_new (FolksGroupable *groupable);
 
-FolksGroups * empathy_groups_widget_get_groupable (
+FolksGroupable * empathy_groups_widget_get_groupable (
     EmpathyGroupsWidget *self);
 void empathy_groups_widget_set_groupable (EmpathyGroupsWidget *self,
-    FolksGroups *groupable);
+    FolksGroupable *groupable);
 
 G_END_DECLS
 
index ee0e06c65bf23b3ebc282b9a009463ced15bdcbd..ebc71a10aa23b5bb5d4323a36789cc816be8ba38 100644 (file)
@@ -236,10 +236,10 @@ groups_change_group_cb (GObject *source,
     GAsyncResult *result,
     gpointer user_data)
 {
-  FolksGroups *groups = FOLKS_GROUPS (source);
+  FolksGroupable *groupable = FOLKS_GROUPABLE (source);
   GError *error = NULL;
 
-  folks_groups_change_group_finish (groups, result, &error);
+  folks_groupable_change_group_finish (groupable, result, &error);
   if (error != NULL)
     {
       g_warning ("failed to change group: %s", error->message);
@@ -385,13 +385,13 @@ real_drag_individual_received_cb (EmpathyIndividualView *self,
 
   if (new_group != NULL)
     {
-      folks_groups_change_group (FOLKS_GROUPS (individual), new_group, TRUE,
+      folks_groupable_change_group (FOLKS_GROUPABLE (individual), new_group, TRUE,
           groups_change_group_cb, NULL);
     }
 
   if (old_group != NULL && action == GDK_ACTION_MOVE)
     {
-      folks_groups_change_group (FOLKS_GROUPS (individual), old_group,
+      folks_groupable_change_group (FOLKS_GROUPABLE (individual), old_group,
           FALSE, groups_change_group_cb, NULL);
     }
 }
index f30343638485291273e726016c84189de2cbfb91..4feda728b38e5bb635cadd11b443eda006be3a6c 100644 (file)
@@ -436,7 +436,7 @@ groups_update (EmpathyIndividualWidget *self)
     {
       empathy_groups_widget_set_groupable (
           EMPATHY_GROUPS_WIDGET (priv->groups_widget),
-          FOLKS_GROUPS (priv->individual));
+          FOLKS_GROUPABLE (priv->individual));
       gtk_widget_show (priv->groups_widget);
     }
   else
@@ -760,8 +760,8 @@ location_update (EmpathyIndividualWidget *self)
 
               /* Add a marker to the map */
               marker = champlain_marker_new_with_text (
-                  folks_alias_get_alias (FOLKS_ALIAS (persona)), NULL, NULL,
-                  NULL);
+                  folks_aliasable_get_alias (FOLKS_ALIASABLE (persona)), NULL,
+                  NULL, NULL);
               champlain_base_marker_set_position (
                   CHAMPLAIN_BASE_MARKER (marker), lat, lon);
               clutter_container_add (CLUTTER_CONTAINER (layer), marker, NULL);
@@ -1057,7 +1057,7 @@ entry_alias_focus_event_cb (GtkEditable *editable,
         }
       else
         {
-          folks_alias_set_alias (FOLKS_ALIAS (priv->individual), alias);
+          folks_aliasable_set_alias (FOLKS_ALIASABLE (priv->individual), alias);
         }
     }
 
@@ -1132,12 +1132,12 @@ notify_alias_cb (gpointer folks_object,
   if (GTK_IS_ENTRY (alias_widget))
     {
       gtk_entry_set_text (GTK_ENTRY (alias_widget),
-          folks_alias_get_alias (FOLKS_ALIAS (folks_object)));
+          folks_aliasable_get_alias (FOLKS_ALIASABLE (folks_object)));
     }
   else
     {
       gtk_label_set_label (GTK_LABEL (alias_widget),
-          folks_alias_get_alias (FOLKS_ALIAS (folks_object)));
+          folks_aliasable_get_alias (FOLKS_ALIASABLE (folks_object)));
     }
 }
 
index 31cd34caadf3941469bafe53d5784ea8545718de..fbeeb6991ae5c1a2a7fd8536eddf254646588f41 100644 (file)
@@ -142,7 +142,7 @@ persona_active_new (EmpathyPersonaStore *self,
   ShowActiveData *data;
 
   DEBUG ("Contact:'%s' now active, and %s be removed",
-      folks_alias_get_alias (FOLKS_ALIAS (persona)),
+      folks_aliasable_get_alias (FOLKS_ALIASABLE (persona)),
       remove_ ? "WILL" : "WILL NOT");
 
   data = g_slice_new0 (ShowActiveData);
@@ -212,7 +212,8 @@ persona_set_active (EmpathyPersonaStore *self,
 static gboolean
 persona_active_cb (ShowActiveData *data)
 {
-  const gchar *alias = folks_alias_get_alias (FOLKS_ALIAS (data->persona));
+  const gchar *alias =
+      folks_aliasable_get_alias (FOLKS_ALIASABLE (data->persona));
 
   if (data->remove)
     {
@@ -234,7 +235,7 @@ persona_updated_cb (FolksPersona *persona,
     EmpathyPersonaStore *self)
 {
   DEBUG ("Contact:'%s' updated, checking roster is in sync...",
-      folks_alias_get_alias (FOLKS_ALIAS (persona)));
+      folks_aliasable_get_alias (FOLKS_ALIASABLE (persona)));
 
   update_persona (self, persona);
 }
@@ -288,7 +289,7 @@ add_persona (EmpathyPersonaStore *self,
 
   priv = GET_PRIV (self);
 
-  alias = folks_alias_get_alias (FOLKS_ALIAS (persona));
+  alias = folks_aliasable_get_alias (FOLKS_ALIASABLE (persona));
   if (EMP_STR_EMPTY (alias))
     return;
 
@@ -407,7 +408,7 @@ update_persona (EmpathyPersonaStore *self,
   const gchar *alias;
 
   path = find_persona (self, persona);
-  alias = folks_alias_get_alias (FOLKS_ALIAS (persona));
+  alias = folks_aliasable_get_alias (FOLKS_ALIASABLE (persona));
 
   if (path == NULL)
     {
@@ -551,8 +552,9 @@ sort_personas (FolksPersona *persona_a,
   g_return_val_if_fail (persona_a != NULL || persona_b != NULL, 0);
 
   /* alias */
-  ret_val = g_utf8_collate (folks_alias_get_alias (FOLKS_ALIAS (persona_a)),
-          folks_alias_get_alias (FOLKS_ALIAS (persona_b)));
+  ret_val = g_utf8_collate (
+      folks_aliasable_get_alias (FOLKS_ALIASABLE (persona_a)),
+      folks_aliasable_get_alias (FOLKS_ALIASABLE (persona_b)));
 
   if (ret_val != 0)
     goto out;
index 6eaa8c3cd0ffe6c7f35b13c84134a56cb30613e2..a7aa0e704fc493bcadee262f3867a21877e2c831 100644 (file)
@@ -703,12 +703,12 @@ empathy_contact_set_alias (EmpathyContact *contact,
 
   /* Set the alias on the persona if possible */
   persona = empathy_contact_get_persona (contact);
-  if (persona != NULL && FOLKS_IS_ALIAS (persona))
+  if (persona != NULL && FOLKS_IS_ALIASABLE (persona))
     {
       DEBUG ("Setting alias for contact %s to %s",
           empathy_contact_get_id (contact), alias);
 
-      folks_alias_set_alias (FOLKS_ALIAS (persona), alias);
+      folks_aliasable_set_alias (FOLKS_ALIASABLE (persona), alias);
     }
 
   if (tp_strdiff (alias, priv->alias))
@@ -726,10 +726,10 @@ groups_change_group_cb (GObject *source,
     GAsyncResult *result,
     gpointer user_data)
 {
-  FolksGroups *groups = FOLKS_GROUPS (source);
+  FolksGroupable *groupable = FOLKS_GROUPABLE (source);
   GError *error = NULL;
 
-  folks_groups_change_group_finish (groups, result, &error);
+  folks_groupable_change_group_finish (groupable, result, &error);
   if (error != NULL)
     {
       g_warning ("failed to change group: %s", error->message);
@@ -753,8 +753,8 @@ empathy_contact_change_group (EmpathyContact *contact, const gchar *group,
   persona = empathy_contact_get_persona (contact);
   if (persona != NULL)
     {
-      if (FOLKS_IS_GROUPS (persona))
-        folks_groups_change_group (FOLKS_GROUPS (persona), group, is_member,
+      if (FOLKS_IS_GROUPABLE (persona))
+        folks_groupable_change_group (FOLKS_GROUPABLE (persona), group, is_member,
           groups_change_group_cb, contact);
       return;
     }
@@ -918,7 +918,7 @@ empathy_contact_set_persona (EmpathyContact *contact,
   /* Set the persona's groups */
   if (priv->groups != NULL)
     {
-      folks_groups_set_groups (FOLKS_GROUPS (persona), priv->groups);
+      folks_groupable_set_groups (FOLKS_GROUPABLE (persona), priv->groups);
       g_hash_table_destroy (priv->groups);
       priv->groups = NULL;
     }
index 968ff1c9812a3eb33b23ea4214d4e53850e4b4df..d707e17bf3fb310946285ac2b4ab492311aa7263 100644 (file)
@@ -464,10 +464,10 @@ groups_change_group_cb (GObject *source,
     GAsyncResult *result,
     gpointer user_data)
 {
-  FolksGroups *groups = FOLKS_GROUPS (source);
+  FolksGroupable *groupable = FOLKS_GROUPABLE (source);
   GError *error = NULL;
 
-  folks_groups_change_group_finish (groups, result, &error);
+  folks_groupable_change_group_finish (groupable, result, &error);
   if (error != NULL)
     {
       g_warning ("failed to change group: %s", error->message);
@@ -480,7 +480,7 @@ remove_group_cb (const gchar *id,
     FolksIndividual *individual,
     const gchar *group)
 {
-  folks_groups_change_group (FOLKS_GROUPS (individual), group, FALSE,
+  folks_groupable_change_group (FOLKS_GROUPABLE (individual), group, FALSE,
       groups_change_group_cb, NULL);
 }
 
index 5e7befd27becef09b1ee22e81a32470a60b60adf..c479f99f38deb99a3de529cca70e4cffa2231631 100644 (file)
@@ -765,7 +765,7 @@ empathy_contact_dup_from_folks_individual (FolksIndividual *individual)
 
 TpChannelGroupChangeReason
 tp_channel_group_change_reason_from_folks_groups_change_reason (
-    FolksGroupsChangeReason reason)
+    FolksGroupableChangeReason reason)
 {
   return (TpChannelGroupChangeReason) reason;
 }
index 0f8adc33e5c1622eb968111e35094327cddfa598..ca184f589b1885ab039487edf26b3df0ef7097d6 100644 (file)
@@ -98,7 +98,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 (FolksGroupsChangeReason reason);
+TpChannelGroupChangeReason tp_channel_group_change_reason_from_folks_groups_change_reason (FolksGroupableChangeReason reason);
 
 gchar * empathy_get_x509_certificate_hostname (gnutls_x509_crt_t cert);