aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk
diff options
context:
space:
mode:
authorLaurent Contzen <lcontzen@gmail.com>2012-07-04 20:06:51 +0800
committerLaurent Contzen <lcontzen@gmail.com>2012-07-23 15:48:42 +0800
commit18ded7a66d2b4ee00d5d36ecc7154566c83dce69 (patch)
tree6453fd30fb64b58570a8d05020a8dc168ec742be /libempathy-gtk
parent87511314e60d6a9c67caaed5d5fd2e3f2f3657c8 (diff)
downloadgsoc2013-empathy-18ded7a66d2b4ee00d5d36ecc7154566c83dce69.tar
gsoc2013-empathy-18ded7a66d2b4ee00d5d36ecc7154566c83dce69.tar.gz
gsoc2013-empathy-18ded7a66d2b4ee00d5d36ecc7154566c83dce69.tar.bz2
gsoc2013-empathy-18ded7a66d2b4ee00d5d36ecc7154566c83dce69.tar.lz
gsoc2013-empathy-18ded7a66d2b4ee00d5d36ecc7154566c83dce69.tar.xz
gsoc2013-empathy-18ded7a66d2b4ee00d5d36ecc7154566c83dce69.tar.zst
gsoc2013-empathy-18ded7a66d2b4ee00d5d36ecc7154566c83dce69.zip
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
Diffstat (limited to 'libempathy-gtk')
-rw-r--r--libempathy-gtk/empathy-roster-model-manager.c26
-rw-r--r--libempathy-gtk/empathy-roster-view.c35
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 b76a7a384..ed414aa85 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 fb157ac90..b54ebc100 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",