summaryrefslogtreecommitdiff
path: root/telepathy-logger/log-manager.c
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-05-21 12:34:41 +0200
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-05-26 12:35:22 +0200
commit7b032fb01100f08efc3beb4ef2a4591262a398a8 (patch)
treeca10dd918b8b2641f5baadb245399b2185c69c28 /telepathy-logger/log-manager.c
parentf34ec7df6a34724ce178ff779d06d024b4fc5e3f (diff)
downloadtelepathy-logger-7b032fb01100f08efc3beb4ef2a4591262a398a8.tar.gz
fix tpl_log_manager_get_dates_finish signature and implementation
We need to return a boolean to indicate if the call succeed or not. Returning NULL in case of failure is wrong as an empty list is represented with NULL as well.
Diffstat (limited to 'telepathy-logger/log-manager.c')
-rw-r--r--telepathy-logger/log-manager.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/telepathy-logger/log-manager.c b/telepathy-logger/log-manager.c
index 224b0e1..ec0d3c1 100644
--- a/telepathy-logger/log-manager.c
+++ b/telepathy-logger/log-manager.c
@@ -859,17 +859,29 @@ _tpl_log_manager_add_message_async (TplLogManager *manager,
/* Start of get_dates async implementation */
-GList *
+gboolean
tpl_log_manager_get_dates_finish (TplLogManager *self,
GAsyncResult *result,
+ GList **dates,
GError **error)
{
- g_return_val_if_fail (error == NULL || *error == NULL, NULL);
+ GSimpleAsyncResult *simple;
- GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (result);
- return g_simple_async_result_get_op_res_gpointer (simple);
-}
+ g_return_val_if_fail (TPL_IS_LOG_MANAGER (self), FALSE);
+ g_return_val_if_fail (G_IS_SIMPLE_ASYNC_RESULT (result), FALSE);
+ g_return_val_if_fail (g_simple_async_result_is_valid (result,
+ G_OBJECT (self), tpl_log_manager_get_dates_async), FALSE);
+
+ simple = G_SIMPLE_ASYNC_RESULT (result);
+ if (g_simple_async_result_propagate_error (simple, error))
+ return FALSE;
+
+ if (dates != NULL)
+ *dates = g_simple_async_result_get_op_res_gpointer (simple);
+
+ return TRUE;
+}
static void
_get_dates_async_result_free (gpointer data)