diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2010-11-01 05:11:35 +0800 |
---|---|---|
committer | Rodrigo Moya <rodrigo@gnome-db.org> | 2010-11-10 06:33:20 +0800 |
commit | 616f0b140bb937d7afeb46f834e32e8c51a67e1e (patch) | |
tree | e9a794d8f2722bb9034f01bf1192b0b16b2e3d57 /mail | |
parent | 4a929caada81820d7499b09875870b84e9900912 (diff) | |
download | gsoc2013-evolution-616f0b140bb937d7afeb46f834e32e8c51a67e1e.tar.gz gsoc2013-evolution-616f0b140bb937d7afeb46f834e32e8c51a67e1e.tar.zst gsoc2013-evolution-616f0b140bb937d7afeb46f834e32e8c51a67e1e.zip |
EActivity: Add an "alert-sink" property.
This is just for convenience, EActivity does not use this property.
Especially useful in async function callbacks when the operation
failed and now you have to do something useful with the GError.
Diffstat (limited to 'mail')
-rw-r--r-- | mail/em-composer-utils.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/mail/em-composer-utils.c b/mail/em-composer-utils.c index 85d5bb26d4..99df9ed1a7 100644 --- a/mail/em-composer-utils.c +++ b/mail/em-composer-utils.c @@ -598,9 +598,14 @@ composer_save_to_drafts_cleanup (CamelFolder *drafts_folder, AsyncContext *context) { CamelSession *session; + EAlertSink *alert_sink; GCancellable *cancellable; GError *error = NULL; + session = e_msg_composer_get_session (context->composer); + alert_sink = e_activity_get_alert_sink (context->activity); + cancellable = e_activity_get_cancellable (context->activity); + e_mail_folder_append_message_finish ( drafts_folder, result, &context->message_uid, &error); @@ -615,7 +620,7 @@ composer_save_to_drafts_cleanup (CamelFolder *drafts_folder, if (error != NULL) { g_warn_if_fail (context->message_uid == NULL); e_alert_submit ( - E_ALERT_SINK (context->composer), + alert_sink, "mail-composer:save-to-drafts-error", error->message, NULL); async_context_free (context); @@ -623,9 +628,6 @@ composer_save_to_drafts_cleanup (CamelFolder *drafts_folder, return; } - session = e_msg_composer_get_session (context->composer); - cancellable = e_activity_get_cancellable (context->activity); - /* Mark the previously saved draft message for deletion. * Note: This is just a nice-to-have; ignore failures. */ e_mail_session_handle_draft_headers ( @@ -761,8 +763,11 @@ composer_save_to_outbox_completed (CamelFolder *outbox_folder, GAsyncResult *result, AsyncContext *context) { + EAlertSink *alert_sink; GError *error = NULL; + alert_sink = e_activity_get_alert_sink (context->activity); + e_mail_folder_append_message_finish ( outbox_folder, result, NULL, &error); @@ -775,7 +780,7 @@ composer_save_to_outbox_completed (CamelFolder *outbox_folder, if (error != NULL) { e_alert_submit ( - E_ALERT_SINK (context->composer), + alert_sink, "mail-composer:append-to-outbox-error", error->message, NULL); g_error_free (error); |