diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2011-10-06 21:35:14 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2011-10-06 21:37:01 +0800 |
commit | 126aa2398abc1bbab0fd0cd76fda5042cc83fe76 (patch) | |
tree | a56dac4e77d7fad6901468564caa09644a1a806b /widgets | |
parent | 938505da180727fbc56b68b80851adc3cf676523 (diff) | |
download | gsoc2013-evolution-126aa2398abc1bbab0fd0cd76fda5042cc83fe76.tar.gz gsoc2013-evolution-126aa2398abc1bbab0fd0cd76fda5042cc83fe76.tar.zst gsoc2013-evolution-126aa2398abc1bbab0fd0cd76fda5042cc83fe76.zip |
Prefer g_simple_async_result_take_error().
Slightly more efficient and convenient than:
g_simple_async_result_set_from_error (simple, error);
g_error_free (error);
One less GError to copy and destroy.
Diffstat (limited to 'widgets')
-rw-r--r-- | widgets/misc/e-attachment-store.c | 18 | ||||
-rw-r--r-- | widgets/misc/e-attachment.c | 15 |
2 files changed, 11 insertions, 22 deletions
diff --git a/widgets/misc/e-attachment-store.c b/widgets/misc/e-attachment-store.c index 2670369a51..8c808d9731 100644 --- a/widgets/misc/e-attachment-store.c +++ b/widgets/misc/e-attachment-store.c @@ -654,10 +654,8 @@ attachment_store_get_uris_save_cb (EAttachment *attachment, if (error == NULL) g_simple_async_result_set_op_res_gpointer (simple, uris, NULL); - else { - g_simple_async_result_set_from_error (simple, error); - g_error_free (error); - } + else + g_simple_async_result_take_error (simple, error); g_simple_async_result_complete (simple); @@ -877,10 +875,8 @@ attachment_store_load_ready_cb (EAttachment *attachment, if (error == NULL) g_simple_async_result_set_op_res_gboolean (simple, TRUE); - else { - g_simple_async_result_set_from_error (simple, error); - g_error_free (error); - } + else + g_simple_async_result_take_error (simple, error); g_simple_async_result_complete (simple); @@ -1158,21 +1154,19 @@ attachment_store_save_cb (EAttachment *attachment, save_context->error = NULL; simple = save_context->simple; - g_simple_async_result_set_from_error (simple, error); + g_simple_async_result_take_error (simple, error); g_simple_async_result_complete (simple); attachment_store_save_context_free (save_context); - g_error_free (error); return; } if (error != NULL) { simple = save_context->simple; - g_simple_async_result_set_from_error (simple, error); + g_simple_async_result_take_error (simple, error); g_simple_async_result_complete (simple); attachment_store_save_context_free (save_context); - g_error_free (error); return; } diff --git a/widgets/misc/e-attachment.c b/widgets/misc/e-attachment.c index ccd135e5a0..4174fe92a5 100644 --- a/widgets/misc/e-attachment.c +++ b/widgets/misc/e-attachment.c @@ -1517,9 +1517,8 @@ attachment_load_check_for_error (LoadContext *load_context, return FALSE; simple = load_context->simple; - g_simple_async_result_set_from_error (simple, error); + g_simple_async_result_take_error (simple, error); g_simple_async_result_complete (simple); - g_error_free (error); attachment_load_context_free (load_context); @@ -2021,9 +2020,8 @@ attachment_open_check_for_error (OpenContext *open_context, return FALSE; simple = open_context->simple; - g_simple_async_result_set_from_error (simple, error); + g_simple_async_result_take_error (simple, error); g_simple_async_result_complete (simple); - g_error_free (error); attachment_open_context_free (open_context); @@ -2064,10 +2062,8 @@ attachment_open_file (GFile *file, g_simple_async_result_set_op_res_gboolean (simple, success); - if (error != NULL) { - g_simple_async_result_set_from_error (simple, error); - g_error_free (error); - } + if (error != NULL) + g_simple_async_result_take_error (simple, error); g_simple_async_result_complete (simple); attachment_open_context_free (open_context); @@ -2324,9 +2320,8 @@ attachment_save_check_for_error (SaveContext *save_context, return FALSE; simple = save_context->simple; - g_simple_async_result_set_from_error (simple, error); + g_simple_async_result_take_error (simple, error); g_simple_async_result_complete (simple); - g_error_free (error); attachment_save_context_free (save_context); |