[empathy] empathy-roster-model-manager: deal with members-changed signals empathy-roster-view: use empathy-ros
- From: Guillaume Desmottes <gdesmott src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [empathy] empathy-roster-model-manager: deal with members-changed signals empathy-roster-view: use empathy-ros
- Date: Mon, 23 Jul 2012 08:00:55 +0000 (UTC)
commit 18ded7a66d2b4ee00d5d36ecc7154566c83dce69
Author: Laurent Contzen <lcontzen gmail com>
Date: Wed Jul 4 14:06:51 2012 +0200
empathy-roster-model-manager: deal with members-changed signals empathy-roster-view: use empathy-roster-model-manager signals
https://bugzilla.gnome.org/show_bug.cgi?id=680302
libempathy-gtk/empathy-roster-model-manager.c | 26 ++++++++++++++++++
libempathy-gtk/empathy-roster-view.c | 35 ++++++++++---------------
2 files changed, 40 insertions(+), 21 deletions(-)
---
diff --git a/libempathy-gtk/empathy-roster-model-manager.c b/libempathy-gtk/empathy-roster-model-manager.c
index b76a7a3..ed414aa 100644
--- a/libempathy-gtk/empathy-roster-model-manager.c
+++ b/libempathy-gtk/empathy-roster-model-manager.c
@@ -55,6 +55,29 @@ struct _EmpathyRosterModelManagerPriv
};
static void
+members_changed_cb (EmpathyIndividualManager *manager,
+ const gchar *message,
+ GList *added,
+ GList *removed,
+ TpChannelGroupChangeReason reason,
+ EmpathyRosterModelManager *self)
+{
+ GList *l;
+
+ for (l = added; l != NULL; l = g_list_next (l))
+ {
+ empathy_roster_model_fire_individual_added (EMPATHY_ROSTER_MODEL (self),
+ l->data);
+ }
+
+ for (l = removed; l != NULL; l = g_list_next (l))
+ {
+ empathy_roster_model_fire_individual_removed (EMPATHY_ROSTER_MODEL (self),
+ l->data);
+ }
+}
+
+static void
empathy_roster_model_manager_get_property (GObject *object,
guint property_id,
GValue *value,
@@ -104,6 +127,9 @@ empathy_roster_model_manager_constructed (GObject *object)
chain_up (object);
g_assert (EMPATHY_IS_INDIVIDUAL_MANAGER (self->priv->manager));
+
+ tp_g_signal_connect_object (self->priv->manager, "members-changed",
+ G_CALLBACK (members_changed_cb), self, 0);
}
static void
diff --git a/libempathy-gtk/empathy-roster-view.c b/libempathy-gtk/empathy-roster-view.c
index fb157ac..b54ebc1 100644
--- a/libempathy-gtk/empathy-roster-view.c
+++ b/libempathy-gtk/empathy-roster-view.c
@@ -521,28 +521,19 @@ individual_removed (EmpathyRosterView *self,
}
static void
-members_changed_cb (EmpathyIndividualManager *manager,
- const gchar *message,
- GList *added,
- GList *removed,
- TpChannelGroupChangeReason reason,
+individual_added_cb (EmpathyRosterModel *model,
+ FolksIndividual *individual,
EmpathyRosterView *self)
{
- GList *l;
-
- for (l = added; l != NULL; l = g_list_next (l))
- {
- FolksIndividual *individual = l->data;
-
- individual_added (self, individual);
- }
-
- for (l = removed; l != NULL; l = g_list_next (l))
- {
- FolksIndividual *individual = l->data;
+ individual_added (self, individual);
+}
- individual_removed (self, individual);
- }
+static void
+individual_removed_cb (EmpathyRosterModel *model,
+ FolksIndividual *individual,
+ EmpathyRosterView *self)
+{
+ individual_removed (self, individual);
}
static gint
@@ -1123,8 +1114,10 @@ empathy_roster_view_constructed (GObject *object)
populate_view (self);
- tp_g_signal_connect_object (self->priv->manager, "members-changed",
- G_CALLBACK (members_changed_cb), self, 0);
+ tp_g_signal_connect_object (self->priv->model, "individual-added",
+ G_CALLBACK (individual_added_cb), self, 0);
+ tp_g_signal_connect_object (self->priv->model, "individual-removed",
+ G_CALLBACK (individual_removed_cb), self, 0);
tp_g_signal_connect_object (self->priv->manager, "groups-changed",
G_CALLBACK (groups_changed_cb), self, 0);
tp_g_signal_connect_object (self->priv->manager, "notify::top-individuals",
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]