diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2012-07-19 16:40:00 +0800 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2012-09-12 17:49:25 +0800 |
commit | c338d01cc24c9e64789615fffa38d0b266543c65 (patch) | |
tree | 573e2d92597cdcabfea70011332996e0983ed048 | |
parent | 484ddd3345d262dc7f2884e9825369d05758858a (diff) | |
download | gsoc2013-empathy-c338d01cc24c9e64789615fffa38d0b266543c65.tar gsoc2013-empathy-c338d01cc24c9e64789615fffa38d0b266543c65.tar.gz gsoc2013-empathy-c338d01cc24c9e64789615fffa38d0b266543c65.tar.bz2 gsoc2013-empathy-c338d01cc24c9e64789615fffa38d0b266543c65.tar.lz gsoc2013-empathy-c338d01cc24c9e64789615fffa38d0b266543c65.tar.xz gsoc2013-empathy-c338d01cc24c9e64789615fffa38d0b266543c65.tar.zst gsoc2013-empathy-c338d01cc24c9e64789615fffa38d0b266543c65.zip |
add empathy_individual_manager_unprepare_async()
https://bugzilla.gnome.org/show_bug.cgi?id=660128
-rw-r--r-- | libempathy/empathy-individual-manager.c | 48 | ||||
-rw-r--r-- | libempathy/empathy-individual-manager.h | 10 |
2 files changed, 58 insertions, 0 deletions
diff --git a/libempathy/empathy-individual-manager.c b/libempathy/empathy-individual-manager.c index 1132f5816..97be8b8a7 100644 --- a/libempathy/empathy-individual-manager.c +++ b/libempathy/empathy-individual-manager.c @@ -440,6 +440,7 @@ individual_manager_dispose (GObject *object) EmpathyIndividualManagerPriv *priv = GET_PRIV (object); g_hash_table_unref (priv->individuals); + tp_clear_object (&priv->aggregator); G_OBJECT_CLASS (empathy_individual_manager_parent_class)->dispose (object); @@ -908,3 +909,50 @@ empathy_individual_manager_get_top_individuals (EmpathyIndividualManager *self) return priv->top_individuals; } + +static void +unprepare_cb (GObject *source, + GAsyncResult *result, + gpointer user_data) +{ + GError *error = NULL; + GSimpleAsyncResult *my_result = user_data; + + folks_individual_aggregator_unprepare_finish ( + FOLKS_INDIVIDUAL_AGGREGATOR (source), result, &error); + + if (error != NULL) + { + DEBUG ("Failed to unprepare the aggregator: %s", error->message); + g_simple_async_result_take_error (my_result, error); + } + + g_simple_async_result_complete (my_result); + g_object_unref (my_result); +} + +void +empathy_individual_manager_unprepare_async ( + EmpathyIndividualManager *self, + GAsyncReadyCallback callback, + gpointer user_data) +{ + EmpathyIndividualManagerPriv *priv = GET_PRIV (self); + GSimpleAsyncResult *result; + + result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, + empathy_individual_manager_unprepare_async); + + folks_individual_aggregator_unprepare (priv->aggregator, unprepare_cb, + result); +} + +gboolean +empathy_individual_manager_unprepare_finish ( + EmpathyIndividualManager *self, + GAsyncResult *result, + GError **error) +{ + empathy_implement_finish_void (self, + empathy_individual_manager_unprepare_async) +} diff --git a/libempathy/empathy-individual-manager.h b/libempathy/empathy-individual-manager.h index d2a5fe90b..fc2704373 100644 --- a/libempathy/empathy-individual-manager.h +++ b/libempathy/empathy-individual-manager.h @@ -89,5 +89,15 @@ gboolean empathy_individual_manager_get_contacts_loaded ( GList * empathy_individual_manager_get_top_individuals ( EmpathyIndividualManager *self); +void empathy_individual_manager_unprepare_async ( + EmpathyIndividualManager *self, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean empathy_individual_manager_unprepare_finish ( + EmpathyIndividualManager *self, + GAsyncResult *result, + GError **error); + G_END_DECLS #endif /* __EMPATHY_INDIVIDUAL_MANAGER_H__ */ |