diff options
author | Laurent Contzen <lcontzen@gmail.com> | 2012-08-04 19:33:14 +0800 |
---|---|---|
committer | Laurent Contzen <lcontzen@gmail.com> | 2012-08-06 17:02:18 +0800 |
commit | 765db7cfd0a0aa7aea9f0f717a7762ad79e14ef9 (patch) | |
tree | 340dab146da0621b265e770824e59e3e332f6abc /libempathy-gtk | |
parent | f54a06dcc9682df323ff98bd8e776bf75da950b0 (diff) | |
download | gsoc2013-empathy-765db7cfd0a0aa7aea9f0f717a7762ad79e14ef9.tar gsoc2013-empathy-765db7cfd0a0aa7aea9f0f717a7762ad79e14ef9.tar.gz gsoc2013-empathy-765db7cfd0a0aa7aea9f0f717a7762ad79e14ef9.tar.bz2 gsoc2013-empathy-765db7cfd0a0aa7aea9f0f717a7762ad79e14ef9.tar.lz gsoc2013-empathy-765db7cfd0a0aa7aea9f0f717a7762ad79e14ef9.tar.xz gsoc2013-empathy-765db7cfd0a0aa7aea9f0f717a7762ad79e14ef9.tar.zst gsoc2013-empathy-765db7cfd0a0aa7aea9f0f717a7762ad79e14ef9.zip |
roster-model now catches notify::favourites-changed
empathy-roster-model: catches notify::favourites-changed and emits favourites-changed
empathy-roster-model-manager: implemented this
empathy-roster-view: now catches favourites-changed from the model
Diffstat (limited to 'libempathy-gtk')
-rw-r--r-- | libempathy-gtk/empathy-roster-model-manager.c | 12 | ||||
-rw-r--r-- | libempathy-gtk/empathy-roster-model.c | 19 | ||||
-rw-r--r-- | libempathy-gtk/empathy-roster-model.h | 4 | ||||
-rw-r--r-- | libempathy-gtk/empathy-roster-view.c | 4 |
4 files changed, 37 insertions, 2 deletions
diff --git a/libempathy-gtk/empathy-roster-model-manager.c b/libempathy-gtk/empathy-roster-model-manager.c index b9e993aea..f507173c8 100644 --- a/libempathy-gtk/empathy-roster-model-manager.c +++ b/libempathy-gtk/empathy-roster-model-manager.c @@ -125,6 +125,16 @@ top_individuals_changed_cb (EmpathyIndividualManager *manager, } static void +favourites_changed_cb (EmpathyIndividualManager *manager, + FolksIndividual *individual, + gboolean favourite, + EmpathyRosterModelManager *self) +{ + empathy_roster_model_fire_favourites_changed (EMPATHY_ROSTER_MODEL (self), + individual, favourite); +} + +static void empathy_roster_model_manager_get_property (GObject *object, guint property_id, GValue *value, @@ -181,6 +191,8 @@ empathy_roster_model_manager_constructed (GObject *object) 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); + tp_g_signal_connect_object (self->priv->manager, "notify::favourites-changed", + G_CALLBACK (favourites_changed_cb), self, 0); } static void diff --git a/libempathy-gtk/empathy-roster-model.c b/libempathy-gtk/empathy-roster-model.c index 198c644c5..671f4b191 100644 --- a/libempathy-gtk/empathy-roster-model.c +++ b/libempathy-gtk/empathy-roster-model.c @@ -29,6 +29,7 @@ enum SIG_INDIVIDUAL_REMOVED, SIG_GROUPS_CHANGED, SIG_TOP_INDIVIDUALS_CHANGED, + SIG_FAVOURITES_CHANGED, LAST_SIGNAL }; @@ -69,6 +70,15 @@ empathy_roster_model_default_init (EmpathyRosterModelInterface *iface) G_SIGNAL_RUN_LAST, 0, NULL, NULL, NULL, G_TYPE_NONE, 0); + + signals[SIG_FAVOURITES_CHANGED] = + g_signal_new ("favourites-changed", + EMPATHY_TYPE_ROSTER_MODEL, + G_SIGNAL_RUN_LAST, + 0, NULL, NULL, NULL, + G_TYPE_NONE, 2, + FOLKS_TYPE_INDIVIDUAL, + G_TYPE_BOOLEAN); } /***** Restricted *****/ @@ -102,6 +112,15 @@ empathy_roster_model_fire_top_individuals_changed (EmpathyRosterModel *self) g_signal_emit (self, signals[SIG_TOP_INDIVIDUALS_CHANGED], 0); } +void +empathy_roster_model_fire_favourites_changed (EmpathyRosterModel *self, + FolksIndividual *individual, + gboolean favourite) +{ + g_signal_emit (self, signals[SIG_FAVOURITES_CHANGED], 0, individual, favourite); +} + + /***** Public *****/ /** diff --git a/libempathy-gtk/empathy-roster-model.h b/libempathy-gtk/empathy-roster-model.h index 507f49d18..d4737b785 100644 --- a/libempathy-gtk/empathy-roster-model.h +++ b/libempathy-gtk/empathy-roster-model.h @@ -74,6 +74,10 @@ void empathy_roster_model_fire_groups_changed (EmpathyRosterModel *self, void empathy_roster_model_fire_top_individuals_changed ( EmpathyRosterModel *self); +void empathy_roster_model_fire_favourites_changed (EmpathyRosterModel *self, + FolksIndividual *individual, + gboolean favourite); + /* 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 c157a12d0..2b8154ecc 100644 --- a/libempathy-gtk/empathy-roster-view.c +++ b/libempathy-gtk/empathy-roster-view.c @@ -1035,7 +1035,7 @@ top_individuals_changed_cb (EmpathyRosterModel *model, } static void -favourites_changed_cb (EmpathyIndividualManager *manager, +favourites_changed_cb (EmpathyRosterModel *model, FolksIndividual *individual, gboolean favourite, EmpathyRosterView *self) @@ -1089,7 +1089,7 @@ empathy_roster_view_constructed (GObject *object) G_CALLBACK (groups_changed_cb), self, 0); 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", + tp_g_signal_connect_object (self->priv->model, "favourites-changed", G_CALLBACK (favourites_changed_cb), self, 0); egg_list_box_set_sort_func (EGG_LIST_BOX (self), |