diff options
Diffstat (limited to 'libempathy-gtk')
-rw-r--r-- | libempathy-gtk/empathy-roster-model-manager.c | 11 | ||||
-rw-r--r-- | libempathy-gtk/empathy-roster-model.c | 14 | ||||
-rw-r--r-- | libempathy-gtk/empathy-roster-model.h | 3 | ||||
-rw-r--r-- | libempathy-gtk/empathy-roster-view.c | 5 |
4 files changed, 30 insertions, 3 deletions
diff --git a/libempathy-gtk/empathy-roster-model-manager.c b/libempathy-gtk/empathy-roster-model-manager.c index be41aceca..b9e993aea 100644 --- a/libempathy-gtk/empathy-roster-model-manager.c +++ b/libempathy-gtk/empathy-roster-model-manager.c @@ -116,6 +116,15 @@ groups_changed_cb (EmpathyIndividualManager *manager, } static void +top_individuals_changed_cb (EmpathyIndividualManager *manager, + GParamSpec *spec, + EmpathyRosterModelManager *self) +{ + empathy_roster_model_fire_top_individuals_changed ( + EMPATHY_ROSTER_MODEL (self)); +} + +static void empathy_roster_model_manager_get_property (GObject *object, guint property_id, GValue *value, @@ -170,6 +179,8 @@ empathy_roster_model_manager_constructed (GObject *object) G_CALLBACK (members_changed_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", + G_CALLBACK (top_individuals_changed_cb), self, 0); } static void diff --git a/libempathy-gtk/empathy-roster-model.c b/libempathy-gtk/empathy-roster-model.c index 37ca594fe..198c644c5 100644 --- a/libempathy-gtk/empathy-roster-model.c +++ b/libempathy-gtk/empathy-roster-model.c @@ -28,6 +28,7 @@ enum SIG_INDIVIDUAL_ADDED, SIG_INDIVIDUAL_REMOVED, SIG_GROUPS_CHANGED, + SIG_TOP_INDIVIDUALS_CHANGED, LAST_SIGNAL }; @@ -61,6 +62,13 @@ empathy_roster_model_default_init (EmpathyRosterModelInterface *iface) FOLKS_TYPE_INDIVIDUAL, G_TYPE_STRING, G_TYPE_BOOLEAN); + + signals[SIG_TOP_INDIVIDUALS_CHANGED] = + g_signal_new ("top-individuals-changed", + EMPATHY_TYPE_ROSTER_MODEL, + G_SIGNAL_RUN_LAST, + 0, NULL, NULL, NULL, + G_TYPE_NONE, 0); } /***** Restricted *****/ @@ -88,6 +96,12 @@ empathy_roster_model_fire_groups_changed (EmpathyRosterModel *self, g_signal_emit (self, signals[SIG_GROUPS_CHANGED], 0, individual, group, is_member); } +void +empathy_roster_model_fire_top_individuals_changed (EmpathyRosterModel *self) +{ + g_signal_emit (self, signals[SIG_TOP_INDIVIDUALS_CHANGED], 0); +} + /***** Public *****/ /** diff --git a/libempathy-gtk/empathy-roster-model.h b/libempathy-gtk/empathy-roster-model.h index 860efd77f..507f49d18 100644 --- a/libempathy-gtk/empathy-roster-model.h +++ b/libempathy-gtk/empathy-roster-model.h @@ -71,6 +71,9 @@ void empathy_roster_model_fire_groups_changed (EmpathyRosterModel *self, const gchar *group, gboolean is_member); +void empathy_roster_model_fire_top_individuals_changed ( + EmpathyRosterModel *self); + /* 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 0b50b0d39..c157a12d0 100644 --- a/libempathy-gtk/empathy-roster-view.c +++ b/libempathy-gtk/empathy-roster-view.c @@ -1028,8 +1028,7 @@ groups_changed_cb (EmpathyRosterModel *model, } static void -top_individuals_changed_cb (EmpathyIndividualManager *manager, - GParamSpec *spec, +top_individuals_changed_cb (EmpathyRosterModel *model, EmpathyRosterView *self) { update_top_contacts (self); @@ -1088,7 +1087,7 @@ empathy_roster_view_constructed (GObject *object) G_CALLBACK (individual_removed_cb), self, 0); 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", + tp_g_signal_connect_object (self->priv->model, "top-individuals-changed", G_CALLBACK (top_individuals_changed_cb), self, 0); tp_g_signal_connect_object (self->priv->manager, "notify::favourites-changed", G_CALLBACK (favourites_changed_cb), self, 0); |