aboutsummaryrefslogtreecommitdiffstats
path: root/mail/em-composer-utils.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2010-11-01 05:11:35 +0800
committerMatthew Barnes <mbarnes@redhat.com>2010-11-01 10:54:30 +0800
commitccc2b3a14bf19b3db1d837887a07e74f50db078c (patch)
tree639b3deaf2fa7e15ebb149a705095fbb0d717a7b /mail/em-composer-utils.c
parent82925c6be94e9e48e4ef521a88a9feec24cf9eef (diff)
downloadgsoc2013-evolution-ccc2b3a14bf19b3db1d837887a07e74f50db078c.tar
gsoc2013-evolution-ccc2b3a14bf19b3db1d837887a07e74f50db078c.tar.gz
gsoc2013-evolution-ccc2b3a14bf19b3db1d837887a07e74f50db078c.tar.bz2
gsoc2013-evolution-ccc2b3a14bf19b3db1d837887a07e74f50db078c.tar.lz
gsoc2013-evolution-ccc2b3a14bf19b3db1d837887a07e74f50db078c.tar.xz
gsoc2013-evolution-ccc2b3a14bf19b3db1d837887a07e74f50db078c.tar.zst
gsoc2013-evolution-ccc2b3a14bf19b3db1d837887a07e74f50db078c.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/em-composer-utils.c')
-rw-r--r--mail/em-composer-utils.c15
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);