diff options
author | Laurent Contzen <lcontzen@gmail.com> | 2012-07-04 20:59:48 +0800 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2012-07-23 22:11:28 +0800 |
commit | 5e102f002d353aceb687f92499635b86a0ba2d9b (patch) | |
tree | 3a5d3e2b6eb0d0717faa0c9aa9380b42fac00ff8 /libempathy-gtk | |
parent | 136088b2686da8dc9fca4e3b77faad28e1a873d1 (diff) | |
download | gsoc2013-empathy-5e102f002d353aceb687f92499635b86a0ba2d9b.tar gsoc2013-empathy-5e102f002d353aceb687f92499635b86a0ba2d9b.tar.gz gsoc2013-empathy-5e102f002d353aceb687f92499635b86a0ba2d9b.tar.bz2 gsoc2013-empathy-5e102f002d353aceb687f92499635b86a0ba2d9b.tar.lz gsoc2013-empathy-5e102f002d353aceb687f92499635b86a0ba2d9b.tar.xz gsoc2013-empathy-5e102f002d353aceb687f92499635b86a0ba2d9b.tar.zst gsoc2013-empathy-5e102f002d353aceb687f92499635b86a0ba2d9b.zip |
empathy-roster-model, empathy-roster-model-manager: Now deals with groups-changed signal empathy-roster-view.c: now uses roster-model's groups-changed signal
https://bugzilla.gnome.org/show_bug.cgi?id=680302
Diffstat (limited to 'libempathy-gtk')
-rw-r--r-- | libempathy-gtk/empathy-roster-model-manager.c | 15 | ||||
-rw-r--r-- | libempathy-gtk/empathy-roster-model.c | 20 | ||||
-rw-r--r-- | libempathy-gtk/empathy-roster-model.h | 5 | ||||
-rw-r--r-- | libempathy-gtk/empathy-roster-view.c | 6 |
4 files changed, 43 insertions, 3 deletions
diff --git a/libempathy-gtk/empathy-roster-model-manager.c b/libempathy-gtk/empathy-roster-model-manager.c index ed414aa85..2684d2765 100644 --- a/libempathy-gtk/empathy-roster-model-manager.c +++ b/libempathy-gtk/empathy-roster-model-manager.c @@ -78,6 +78,19 @@ members_changed_cb (EmpathyIndividualManager *manager, } static void +groups_changed_cb (EmpathyIndividualManager *manager, + FolksIndividual *individual, + const gchar *group, + gboolean is_member, + EmpathyRosterModelManager *self) +{ + empathy_roster_model_fire_groups_changed (EMPATHY_ROSTER_MODEL (self), + individual, + group, + is_member); +} + +static void empathy_roster_model_manager_get_property (GObject *object, guint property_id, GValue *value, @@ -130,6 +143,8 @@ empathy_roster_model_manager_constructed (GObject *object) tp_g_signal_connect_object (self->priv->manager, "members-changed", G_CALLBACK (members_changed_cb), self, 0); + tp_g_signal_connect_object (self->priv->manager, "groups-changed", + G_CALLBACK (groups_changed_cb), self, 0); } static void diff --git a/libempathy-gtk/empathy-roster-model.c b/libempathy-gtk/empathy-roster-model.c index ce86e58a6..eaceca5f7 100644 --- a/libempathy-gtk/empathy-roster-model.c +++ b/libempathy-gtk/empathy-roster-model.c @@ -27,6 +27,7 @@ enum { SIG_INDIVIDUAL_ADDED, SIG_INDIVIDUAL_REMOVED, + SIG_GROUPS_CHANGED, LAST_SIGNAL }; @@ -50,6 +51,16 @@ empathy_roster_model_default_init (EmpathyRosterModelInterface *iface) 0, NULL, NULL, NULL, G_TYPE_NONE, 1, FOLKS_TYPE_INDIVIDUAL); + + signals[SIG_GROUPS_CHANGED] = + g_signal_new ("groups-changed", + EMPATHY_TYPE_ROSTER_MODEL, + G_SIGNAL_RUN_LAST, + 0, NULL, NULL, NULL, + G_TYPE_NONE, 3, + FOLKS_TYPE_INDIVIDUAL, + G_TYPE_STRING, + G_TYPE_BOOLEAN); } /***** Restricted *****/ @@ -68,6 +79,15 @@ empathy_roster_model_fire_individual_removed (EmpathyRosterModel *self, g_signal_emit (self, signals[SIG_INDIVIDUAL_REMOVED], 0, individual); } +void +empathy_roster_model_fire_groups_changed (EmpathyRosterModel *self, + FolksIndividual *individual, + const gchar *group, + gboolean is_member) +{ + g_signal_emit (self, signals[SIG_GROUPS_CHANGED], 0, individual, group, is_member); +} + /***** Public *****/ GList * diff --git a/libempathy-gtk/empathy-roster-model.h b/libempathy-gtk/empathy-roster-model.h index e6c382825..59db96f0c 100644 --- a/libempathy-gtk/empathy-roster-model.h +++ b/libempathy-gtk/empathy-roster-model.h @@ -63,6 +63,11 @@ void empathy_roster_model_fire_individual_added (EmpathyRosterModel *self, void empathy_roster_model_fire_individual_removed (EmpathyRosterModel *self, FolksIndividual *individual); +void empathy_roster_model_fire_groups_changed (EmpathyRosterModel *self, + FolksIndividual *individual, + const gchar *group, + gboolean is_member); + /* Public API */ GList * empathy_roster_model_get_individuals (EmpathyRosterModel *self); diff --git a/libempathy-gtk/empathy-roster-view.c b/libempathy-gtk/empathy-roster-view.c index 90d7296eb..b07a4b252 100644 --- a/libempathy-gtk/empathy-roster-view.c +++ b/libempathy-gtk/empathy-roster-view.c @@ -1040,9 +1040,9 @@ update_top_contacts (EmpathyRosterView *self) } static void -groups_changed_cb (EmpathyIndividualManager *manager, +groups_changed_cb (EmpathyRosterModel *model, FolksIndividual *individual, - gchar *group, + const gchar *group, gboolean is_member, EmpathyRosterView *self) { @@ -1118,7 +1118,7 @@ empathy_roster_view_constructed (GObject *object) 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", + tp_g_signal_connect_object (self->priv->model, "groups-changed", G_CALLBACK (groups_changed_cb), self, 0); tp_g_signal_connect_object (self->priv->manager, "notify::top-individuals", G_CALLBACK (top_individuals_changed_cb), self, 0); |