diff options
author | Laurent Contzen <lcontzen@gmail.com> | 2012-08-04 19:19:44 +0800 |
---|---|---|
committer | Laurent Contzen <lcontzen@gmail.com> | 2012-08-06 17:02:18 +0800 |
commit | f54a06dcc9682df323ff98bd8e776bf75da950b0 (patch) | |
tree | c16f03b78f2f384cbd53584392df0179d13d14c2 /libempathy-gtk | |
parent | 93da7465f929f0cb950adb76e7b645f5ff23f1ad (diff) | |
download | gsoc2013-empathy-f54a06dcc9682df323ff98bd8e776bf75da950b0.tar gsoc2013-empathy-f54a06dcc9682df323ff98bd8e776bf75da950b0.tar.gz gsoc2013-empathy-f54a06dcc9682df323ff98bd8e776bf75da950b0.tar.bz2 gsoc2013-empathy-f54a06dcc9682df323ff98bd8e776bf75da950b0.tar.lz gsoc2013-empathy-f54a06dcc9682df323ff98bd8e776bf75da950b0.tar.xz gsoc2013-empathy-f54a06dcc9682df323ff98bd8e776bf75da950b0.tar.zst gsoc2013-empathy-f54a06dcc9682df323ff98bd8e776bf75da950b0.zip |
roster-model now catches notify::top-individuals
empathy-roster-model: catches notify::top-individuals and emits top-individuals-changed
empathy-roster-model-manager: implemented this
empathy-roster-view: now catches top-individuals-changed from the model
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); |