diff options
author | Jonny Lamb <jonnylamb@gnome.org> | 2011-02-01 16:41:39 +0800 |
---|---|---|
committer | Jonny Lamb <jonnylamb@gnome.org> | 2011-02-01 16:47:08 +0800 |
commit | b03dfefd8103ea41f61407df122021a6d14d5a19 (patch) | |
tree | 36f464b0cd25dcc3c42c03fd62bac510b86c25e5 | |
parent | 267fb729f0536843bcb7c42858bd3d6a6d029411 (diff) | |
download | gsoc2013-empathy-b03dfefd8103ea41f61407df122021a6d14d5a19.tar gsoc2013-empathy-b03dfefd8103ea41f61407df122021a6d14d5a19.tar.gz gsoc2013-empathy-b03dfefd8103ea41f61407df122021a6d14d5a19.tar.bz2 gsoc2013-empathy-b03dfefd8103ea41f61407df122021a6d14d5a19.tar.lz gsoc2013-empathy-b03dfefd8103ea41f61407df122021a6d14d5a19.tar.xz gsoc2013-empathy-b03dfefd8103ea41f61407df122021a6d14d5a19.tar.zst gsoc2013-empathy-b03dfefd8103ea41f61407df122021a6d14d5a19.zip |
keyring: use the recently added finish macros
Signed-off-by: Jonny Lamb <jonnylamb@gnome.org>
-rw-r--r-- | libempathy/empathy-keyring.c | 79 |
1 files changed, 9 insertions, 70 deletions
diff --git a/libempathy/empathy-keyring.c b/libempathy/empathy-keyring.c index bde950b78..f8422c151 100644 --- a/libempathy/empathy-keyring.c +++ b/libempathy/empathy-keyring.c @@ -24,6 +24,8 @@ #include <gnome-keyring.h> +#include "empathy-utils.h" + #define DEBUG_FLAG EMPATHY_DEBUG_OTHER #include "empathy-debug.h" @@ -146,20 +148,8 @@ empathy_keyring_get_account_password_finish (TpAccount *account, GAsyncResult *result, GError **error) { - GSimpleAsyncResult *simple; - - g_return_val_if_fail (TP_IS_ACCOUNT (account), NULL); - g_return_val_if_fail (G_IS_SIMPLE_ASYNC_RESULT (result), NULL); - - simple = G_SIMPLE_ASYNC_RESULT (result); - - if (g_simple_async_result_propagate_error (simple, error)) - return NULL; - - g_return_val_if_fail (g_simple_async_result_is_valid (result, - G_OBJECT (account), empathy_keyring_get_room_password_async), NULL); - - return g_simple_async_result_get_op_res_gpointer (simple); + empathy_implement_finish_return_pointer (account, + empathy_keyring_get_account_password_async); } const gchar * @@ -167,20 +157,8 @@ empathy_keyring_get_room_password_finish (TpAccount *account, GAsyncResult *result, GError **error) { - GSimpleAsyncResult *simple; - - g_return_val_if_fail (TP_IS_ACCOUNT (account), NULL); - g_return_val_if_fail (G_IS_SIMPLE_ASYNC_RESULT (result), NULL); - - simple = G_SIMPLE_ASYNC_RESULT (result); - - if (g_simple_async_result_propagate_error (simple, error)) - return NULL; - - g_return_val_if_fail (g_simple_async_result_is_valid (result, - G_OBJECT (account), empathy_keyring_get_room_password_async), NULL); - - return g_simple_async_result_get_op_res_gpointer (simple); + empathy_implement_finish_return_pointer (account, + empathy_keyring_get_room_password_async); } /* set */ @@ -277,20 +255,7 @@ empathy_keyring_set_account_password_finish (TpAccount *account, GAsyncResult *result, GError **error) { - GSimpleAsyncResult *simple; - - g_return_val_if_fail (TP_IS_ACCOUNT (account), FALSE); - g_return_val_if_fail (G_IS_SIMPLE_ASYNC_RESULT (result), FALSE); - - simple = G_SIMPLE_ASYNC_RESULT (result); - - if (g_simple_async_result_propagate_error (simple, error)) - return FALSE; - - g_return_val_if_fail (g_simple_async_result_is_valid (result, - G_OBJECT (account), empathy_keyring_set_account_password_async), FALSE); - - return TRUE; + empathy_implement_finish_void (account, empathy_keyring_set_account_password_async); } gboolean @@ -298,20 +263,7 @@ empathy_keyring_set_room_password_finish (TpAccount *account, GAsyncResult *result, GError **error) { - GSimpleAsyncResult *simple; - - g_return_val_if_fail (TP_IS_ACCOUNT (account), FALSE); - g_return_val_if_fail (G_IS_SIMPLE_ASYNC_RESULT (result), FALSE); - - simple = G_SIMPLE_ASYNC_RESULT (result); - - if (g_simple_async_result_propagate_error (simple, error)) - return FALSE; - - g_return_val_if_fail (g_simple_async_result_is_valid (result, - G_OBJECT (account), empathy_keyring_set_room_password_async), FALSE); - - return TRUE; + empathy_implement_finish_void (account, empathy_keyring_set_room_password_async); } /* delete */ @@ -395,19 +347,6 @@ empathy_keyring_delete_account_password_finish (TpAccount *account, GAsyncResult *result, GError **error) { - GSimpleAsyncResult *simple; - - g_return_val_if_fail (TP_IS_ACCOUNT (account), FALSE); - g_return_val_if_fail (G_IS_SIMPLE_ASYNC_RESULT (result), FALSE); - - simple = G_SIMPLE_ASYNC_RESULT (result); - - if (g_simple_async_result_propagate_error (simple, error)) - return FALSE; - - g_return_val_if_fail (g_simple_async_result_is_valid (result, - G_OBJECT (account), empathy_keyring_delete_account_password_async), FALSE); - - return TRUE; + empathy_implement_finish_void (account, empathy_keyring_delete_account_password_async); } |