[evolution/email-factory-3-4: 6/38] Ported 126aa2398abc1bbab0fd0cd76fda5042cc83fe76
- From: Srinivasa Ragavan <sragavan src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution/email-factory-3-4: 6/38] Ported 126aa2398abc1bbab0fd0cd76fda5042cc83fe76
- Date: Fri, 16 Dec 2011 11:54:58 +0000 (UTC)
commit 308700ac5f74cfa4c181c7496aebc0fd6b87f803
Author: Srinivasa Ragavan <sragavan gnome org>
Date: Mon Oct 31 11:45:01 2011 +0530
Ported 126aa2398abc1bbab0fd0cd76fda5042cc83fe76
libemail-engine/e-mail-folder-utils.c | 42 ++++++++++---------------------
libemail-engine/e-mail-session-utils.c | 33 ++++++++----------------
libemail-engine/e-mail-session.c | 18 ++++---------
libemail-engine/e-mail-store-utils.c | 24 ++++++------------
4 files changed, 39 insertions(+), 78 deletions(-)
---
diff --git a/libemail-engine/e-mail-folder-utils.c b/libemail-engine/e-mail-folder-utils.c
index 7f1e86e..bca0dda 100644
--- a/libemail-engine/e-mail-folder-utils.c
+++ b/libemail-engine/e-mail-folder-utils.c
@@ -84,10 +84,8 @@ mail_folder_append_message_thread (GSimpleAsyncResult *simple,
context->info, &context->message_uid,
cancellable, &error);
- 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);
}
gboolean
@@ -199,10 +197,8 @@ mail_folder_build_attachment_thread (GSimpleAsyncResult *simple,
CAMEL_FOLDER (object), context->ptr_array,
&context->fwd_subject, cancellable, &error);
- 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);
}
CamelMimePart *
@@ -359,10 +355,8 @@ mail_folder_find_duplicate_messages_thread (GSimpleAsyncResult *simple,
CAMEL_FOLDER (object), context->ptr_array,
cancellable, &error);
- 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);
}
GHashTable *
@@ -559,10 +553,8 @@ mail_folder_get_multiple_messages_thread (GSimpleAsyncResult *simple,
CAMEL_FOLDER (object), context->ptr_array,
cancellable, &error);
- 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);
}
GHashTable *
@@ -685,10 +677,8 @@ mail_folder_remove_thread (GSimpleAsyncResult *simple,
e_mail_folder_remove_sync (
CAMEL_FOLDER (object), cancellable, &error);
- 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);
}
static gboolean
@@ -912,10 +902,8 @@ mail_folder_remove_attachments_thread (GSimpleAsyncResult *simple,
CAMEL_FOLDER (object), context->ptr_array,
cancellable, &error);
- 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);
}
/* Helper for e_mail_folder_remove_attachments_sync() */
@@ -1128,10 +1116,8 @@ mail_folder_save_messages_thread (GSimpleAsyncResult *simple,
CAMEL_FOLDER (object), context->ptr_array,
context->destination, cancellable, &error);
- 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);
}
/* Helper for e_mail_folder_save_messages_sync() */
diff --git a/libemail-engine/e-mail-session-utils.c b/libemail-engine/e-mail-session-utils.c
index 9a55891..09fc2d5 100644
--- a/libemail-engine/e-mail-session-utils.c
+++ b/libemail-engine/e-mail-session-utils.c
@@ -133,10 +133,8 @@ mail_session_handle_draft_headers_thread (GSimpleAsyncResult *simple,
e_mail_session_handle_draft_headers_sync (
session, context->message, cancellable, &error);
- 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);
}
gboolean
@@ -251,10 +249,8 @@ mail_session_handle_source_headers_thread (GSimpleAsyncResult *simple,
e_mail_session_handle_source_headers_sync (
session, context->message, cancellable, &error);
- 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);
}
gboolean
@@ -428,8 +424,7 @@ mail_session_send_to_thread (GSimpleAsyncResult *simple,
/* XXX This API does not allow for cancellation. */
if (!em_utils_connect_service_sync (service, cancellable, &error)) {
- g_simple_async_result_set_from_error (simple, error);
- g_error_free (error);
+ g_simple_async_result_take_error (simple, error);
return;
}
}
@@ -450,8 +445,7 @@ mail_session_send_to_thread (GSimpleAsyncResult *simple,
cancellable, error ? NULL : &error);
if (error != NULL) {
- g_simple_async_result_set_from_error (simple, error);
- g_error_free (error);
+ g_simple_async_result_take_error (simple, error);
return;
}
}
@@ -468,8 +462,7 @@ mail_session_send_to_thread (GSimpleAsyncResult *simple,
if (error != NULL) {
g_warn_if_fail (folder == NULL);
- g_simple_async_result_set_from_error (simple, error);
- g_error_free (error);
+ g_simple_async_result_take_error (simple, error);
return;
}
@@ -482,8 +475,7 @@ mail_session_send_to_thread (GSimpleAsyncResult *simple,
g_object_unref (folder);
if (error != NULL) {
- g_simple_async_result_set_from_error (simple, error);
- g_error_free (error);
+ g_simple_async_result_take_error (simple, error);
return;
}
}
@@ -617,8 +609,7 @@ exit:
/* If we were cancelled, disregard any other errors. */
if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
- g_simple_async_result_set_from_error (simple, error);
- g_error_free (error);
+ g_simple_async_result_take_error (simple, error);
/* Stuff the accumulated error messages in a GError. */
} else if (error_messages->len > 0) {
@@ -845,10 +836,8 @@ mail_session_unsubscribe_folder_thread (GSimpleAsyncResult *simple,
e_mail_session_unsubscribe_folder_sync (
session, context->folder_uri, cancellable, &error);
- 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);
}
gboolean
diff --git a/libemail-engine/e-mail-session.c b/libemail-engine/e-mail-session.c
index b8a9c37..6139779 100644
--- a/libemail-engine/e-mail-session.c
+++ b/libemail-engine/e-mail-session.c
@@ -1174,10 +1174,8 @@ mail_session_get_inbox_thread (GSimpleAsyncResult *simple,
context->folder = e_mail_session_get_inbox_sync (
session, context->uid, cancellable, &error);
- 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);
}
CamelFolder *
@@ -1273,10 +1271,8 @@ mail_session_get_trash_thread (GSimpleAsyncResult *simple,
context->folder = e_mail_session_get_trash_sync (
session, context->uid, cancellable, &error);
- 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);
}
CamelFolder *
@@ -1373,10 +1369,8 @@ mail_session_uri_to_folder_thread (GSimpleAsyncResult *simple,
session, context->uri, context->flags,
cancellable, &error);
- 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);
}
CamelFolder *
diff --git a/libemail-engine/e-mail-store-utils.c b/libemail-engine/e-mail-store-utils.c
index 0d31525..757f86d 100644
--- a/libemail-engine/e-mail-store-utils.c
+++ b/libemail-engine/e-mail-store-utils.c
@@ -54,10 +54,8 @@ mail_store_create_folder_thread (GSimpleAsyncResult *simple,
CAMEL_STORE (object), context->full_name,
cancellable, &error);
- 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);
}
gboolean
@@ -191,10 +189,8 @@ mail_store_go_offline_thread (GSimpleAsyncResult *simple,
} else
em_utils_disconnect_service_sync (service, TRUE, cancellable, &error);
- 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);
camel_operation_pop_message (cancellable);
}
@@ -270,10 +266,8 @@ mail_store_go_online_thread (GSimpleAsyncResult *simple,
CAMEL_OFFLINE_STORE (store),
TRUE, cancellable, &error);
- 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);
camel_operation_pop_message (cancellable);
}
@@ -343,10 +337,8 @@ mail_store_prepare_for_offline_thread (GSimpleAsyncResult *simple,
camel_offline_store_prepare_for_offline_sync (
CAMEL_OFFLINE_STORE (store), cancellable, &error);
- 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);
camel_operation_pop_message (cancellable);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]