aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilip Withnall <philip.withnall@collabora.co.uk>2010-09-15 22:23:14 +0800
committerTravis Reitter <travis.reitter@collabora.co.uk>2010-10-05 00:02:09 +0800
commit53aa7c1e6546214568969fe727926f7740a26127 (patch)
treec5f83e4ad2a0ec37b05de040f1a6c000052c7665
parent3195780450fdcfe8678bf29e5fd20cb957283bc2 (diff)
downloadgsoc2013-empathy-53aa7c1e6546214568969fe727926f7740a26127.tar
gsoc2013-empathy-53aa7c1e6546214568969fe727926f7740a26127.tar.gz
gsoc2013-empathy-53aa7c1e6546214568969fe727926f7740a26127.tar.bz2
gsoc2013-empathy-53aa7c1e6546214568969fe727926f7740a26127.tar.lz
gsoc2013-empathy-53aa7c1e6546214568969fe727926f7740a26127.tar.xz
gsoc2013-empathy-53aa7c1e6546214568969fe727926f7740a26127.tar.zst
gsoc2013-empathy-53aa7c1e6546214568969fe727926f7740a26127.zip
Port Empathy to use FolksAliasable and FolksGroupable
FolksAliasable is the new name for FolksAlias, and FolksGroupable is the new name for FolksGroups.
-rw-r--r--configure.ac2
-rw-r--r--libempathy-gtk/empathy-contact-widget.c4
-rw-r--r--libempathy-gtk/empathy-groups-widget.c48
-rw-r--r--libempathy-gtk/empathy-groups-widget.h6
-rw-r--r--libempathy-gtk/empathy-individual-view.c8
-rw-r--r--libempathy-gtk/empathy-individual-widget.c12
-rw-r--r--libempathy-gtk/empathy-persona-store.c16
-rw-r--r--libempathy/empathy-contact.c14
-rw-r--r--libempathy/empathy-individual-manager.c6
-rw-r--r--libempathy/empathy-utils.c2
-rw-r--r--libempathy/empathy-utils.h2
11 files changed, 61 insertions, 59 deletions
diff --git a/configure.ac b/configure.ac
index 7abcf0f11..8b498d97d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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
diff --git a/libempathy-gtk/empathy-contact-widget.c b/libempathy-gtk/empathy-contact-widget.c
index eaacc6316..4701abede 100644
--- a/libempathy-gtk/empathy-contact-widget.c
+++ b/libempathy-gtk/empathy-contact-widget.c
@@ -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;
diff --git a/libempathy-gtk/empathy-groups-widget.c b/libempathy-gtk/empathy-groups-widget.c
index 8d878b7d3..f8a1847d1 100644
--- a/libempathy-gtk/empathy-groups-widget.c
+++ b/libempathy-gtk/empathy-groups-widget.c
@@ -40,10 +40,10 @@
/**
* 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);
diff --git a/libempathy-gtk/empathy-groups-widget.h b/libempathy-gtk/empathy-groups-widget.h
index 120d45e7e..d74750194 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 (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
diff --git a/libempathy-gtk/empathy-individual-view.c b/libempathy-gtk/empathy-individual-view.c
index ee0e06c65..ebc71a10a 100644
--- a/libempathy-gtk/empathy-individual-view.c
+++ b/libempathy-gtk/empathy-individual-view.c
@@ -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);
}
}
diff --git a/libempathy-gtk/empathy-individual-widget.c b/libempathy-gtk/empathy-individual-widget.c
index f30343638..4feda728b 100644
--- a/libempathy-gtk/empathy-individual-widget.c
+++ b/libempathy-gtk/empathy-individual-widget.c
@@ -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)));
}
}
diff --git a/libempathy-gtk/empathy-persona-store.c b/libempathy-gtk/empathy-persona-store.c
index 31cd34caa..fbeeb6991 100644
--- a/libempathy-gtk/empathy-persona-store.c
+++ b/libempathy-gtk/empathy-persona-store.c
@@ -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;
diff --git a/libempathy/empathy-contact.c b/libempathy/empathy-contact.c
index 6eaa8c3cd..a7aa0e704 100644
--- a/libempathy/empathy-contact.c
+++ b/libempathy/empathy-contact.c
@@ -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;
}
diff --git a/libempathy/empathy-individual-manager.c b/libempathy/empathy-individual-manager.c
index 968ff1c98..d707e17bf 100644
--- a/libempathy/empathy-individual-manager.c
+++ b/libempathy/empathy-individual-manager.c
@@ -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);
}
diff --git a/libempathy/empathy-utils.c b/libempathy/empathy-utils.c
index 5e7befd27..c479f99f3 100644
--- a/libempathy/empathy-utils.c
+++ b/libempathy/empathy-utils.c
@@ -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;
}
diff --git a/libempathy/empathy-utils.h b/libempathy/empathy-utils.h
index 0f8adc33e..ca184f589 100644
--- a/libempathy/empathy-utils.h
+++ b/libempathy/empathy-utils.h
@@ -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);