aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy
diff options
context:
space:
mode:
authorPhilip Withnall <philip.withnall@collabora.co.uk>2010-06-25 20:48:43 +0800
committerTravis Reitter <treitter@gmail.com>2010-07-21 07:12:35 +0800
commit0dea2287893dc5cf657bb48c2707e30139118cb4 (patch)
tree201dc32d44563497991b905ced98b39ead7b61cf /libempathy
parente54fe4814b321be3e32e99f7dfd49b93e392bded (diff)
downloadgsoc2013-empathy-0dea2287893dc5cf657bb48c2707e30139118cb4.tar
gsoc2013-empathy-0dea2287893dc5cf657bb48c2707e30139118cb4.tar.gz
gsoc2013-empathy-0dea2287893dc5cf657bb48c2707e30139118cb4.tar.bz2
gsoc2013-empathy-0dea2287893dc5cf657bb48c2707e30139118cb4.tar.lz
gsoc2013-empathy-0dea2287893dc5cf657bb48c2707e30139118cb4.tar.xz
gsoc2013-empathy-0dea2287893dc5cf657bb48c2707e30139118cb4.tar.zst
gsoc2013-empathy-0dea2287893dc5cf657bb48c2707e30139118cb4.zip
Finish adding favourites support
Diffstat (limited to 'libempathy')
-rw-r--r--libempathy/empathy-individual-manager.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/libempathy/empathy-individual-manager.c b/libempathy/empathy-individual-manager.c
index 53843ce93..f162ba353 100644
--- a/libempathy/empathy-individual-manager.c
+++ b/libempathy/empathy-individual-manager.c
@@ -66,6 +66,16 @@ individual_group_changed_cb (FolksIndividual *individual,
}
static void
+individual_notify_is_favourite_cb (FolksIndividual *individual,
+ GParamSpec *pspec,
+ EmpathyIndividualManager *self)
+{
+ gboolean is_favourite = folks_favourite_get_is_favourite (
+ FOLKS_FAVOURITE (individual));
+ g_signal_emit_by_name (self, "favourites-changed", individual, is_favourite);
+}
+
+static void
aggregator_individuals_added_cb (FolksIndividualAggregator *aggregator,
GList *individuals,
EmpathyIndividualManager *self)
@@ -76,6 +86,8 @@ aggregator_individuals_added_cb (FolksIndividualAggregator *aggregator,
{
g_signal_connect (l->data, "group-changed",
G_CALLBACK (individual_group_changed_cb), self);
+ g_signal_connect (l->data, "notify::is-favourite",
+ G_CALLBACK (individual_notify_is_favourite_cb), self);
}
/* TODO: don't hard-code the reason or message */
@@ -95,6 +107,8 @@ aggregator_individuals_removed_cb (FolksIndividualAggregator *aggregator,
{
g_signal_handlers_disconnect_by_func (l->data,
individual_group_changed_cb, self);
+ g_signal_handlers_disconnect_by_func (l->data,
+ individual_notify_is_favourite_cb, self);
}
/* TODO: don't hard-code the reason or message */
@@ -175,6 +189,14 @@ empathy_individual_manager_class_init (EmpathyIndividualManagerClass *klass)
_empathy_marshal_VOID__OBJECT_STRING_BOOLEAN,
G_TYPE_NONE, 3, FOLKS_TYPE_INDIVIDUAL, G_TYPE_STRING, G_TYPE_BOOLEAN);
+ g_signal_new ("favourites-changed",
+ G_TYPE_FROM_CLASS (klass),
+ G_SIGNAL_RUN_LAST,
+ 0,
+ NULL, NULL,
+ _empathy_marshal_VOID__OBJECT_BOOLEAN,
+ G_TYPE_NONE, 2, FOLKS_TYPE_INDIVIDUAL, G_TYPE_BOOLEAN);
+
g_signal_new ("members-changed",
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,