From 9acc98e7c25b1b9bb7f779c595e05a9d88035c48 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Fri, 27 Sep 2013 12:17:07 +0200 Subject: log-manager: factor out start_async_op_in_thread() https://bugs.freedesktop.org/show_bug.cgi?id=69814 --- telepathy-logger/log-manager.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/telepathy-logger/log-manager.c b/telepathy-logger/log-manager.c index 62d0f74..944b741 100644 --- a/telepathy-logger/log-manager.c +++ b/telepathy-logger/log-manager.c @@ -871,6 +871,14 @@ _get_dates_async_thread (GSimpleAsyncResult *simple, } +static void +start_async_op_in_thread (TpAccount *account, + GSimpleAsyncResult *result, + GSimpleAsyncThreadFunc func) +{ + g_simple_async_result_run_in_thread (result, func, 0, NULL); +} + /** * tpl_log_manager_get_dates_async: * @manager: a #TplLogManager @@ -917,8 +925,7 @@ tpl_log_manager_get_dates_async (TplLogManager *manager, _tpl_log_manager_async_operation_cb, async_data, tpl_log_manager_get_dates_async); - g_simple_async_result_run_in_thread (simple, _get_dates_async_thread, 0, - NULL); + start_async_op_in_thread (account, simple, _get_dates_async_thread); g_object_unref (simple); } @@ -1028,8 +1035,7 @@ tpl_log_manager_get_events_for_date_async (TplLogManager *manager, _tpl_log_manager_async_operation_cb, async_data, tpl_log_manager_get_events_for_date_async); - g_simple_async_result_run_in_thread (simple, - _get_events_for_date_async_thread, 0, NULL); + start_async_op_in_thread (account, simple, _get_events_for_date_async_thread); g_object_unref (simple); } @@ -1145,8 +1151,7 @@ tpl_log_manager_get_filtered_events_async (TplLogManager *manager, _tpl_log_manager_async_operation_cb, async_data, tpl_log_manager_get_filtered_events_async); - g_simple_async_result_run_in_thread (simple, - _get_filtered_events_async_thread, 0, NULL); + start_async_op_in_thread (account, simple, _get_filtered_events_async_thread); g_object_unref (simple); } @@ -1286,8 +1291,7 @@ tpl_log_manager_get_entities_async (TplLogManager *self, _tpl_log_manager_async_operation_cb, async_data, tpl_log_manager_get_entities_async); - g_simple_async_result_run_in_thread (simple, _get_entities_async_thread, 0, - NULL); + start_async_op_in_thread (account, simple, _get_entities_async_thread); g_object_unref (simple); } @@ -1386,8 +1390,7 @@ tpl_log_manager_search_async (TplLogManager *manager, _tpl_log_manager_async_operation_cb, async_data, tpl_log_manager_search_async); - g_simple_async_result_run_in_thread (simple, _search_async_thread, 0, - NULL); + start_async_op_in_thread (NULL, simple, _search_async_thread); g_object_unref (simple); } -- cgit v1.2.1