aboutsummaryrefslogtreecommitdiffstats
path: root/mail/e-mail-backend.c
diff options
context:
space:
mode:
Diffstat (limited to 'mail/e-mail-backend.c')
-rw-r--r--mail/e-mail-backend.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/mail/e-mail-backend.c b/mail/e-mail-backend.c
index 610e8913fa..efb3521b06 100644
--- a/mail/e-mail-backend.c
+++ b/mail/e-mail-backend.c
@@ -138,17 +138,8 @@ mail_backend_prepare_for_offline_cb (EShell *shell,
GQueue queue = G_QUEUE_INIT;
gboolean synchronize = FALSE;
- if (e_shell_backend_is_started (E_SHELL_BACKEND (backend))) {
- if (!e_activity_get_cancellable (activity)) {
- GCancellable *cancellable;
-
- cancellable = camel_operation_new ();
- e_activity_set_cancellable (activity, cancellable);
- g_object_unref (cancellable);
- }
-
+ if (e_shell_backend_is_started (E_SHELL_BACKEND (backend)))
e_shell_backend_add_activity (E_SHELL_BACKEND (backend), activity);
- }
window = e_shell_get_active_window (shell);
session = e_mail_backend_get_session (backend);
@@ -165,6 +156,17 @@ mail_backend_prepare_for_offline_cb (EShell *shell,
CAMEL_SESSION (session), FALSE);
}
+ /* Set the cancellable only here, because mail_cancel_all() would
+ cancel the just added CamelOperation as well. */
+ if (e_shell_backend_is_started (E_SHELL_BACKEND (backend)) &&
+ !e_activity_get_cancellable (activity)) {
+ GCancellable *cancellable;
+
+ cancellable = camel_operation_new ();
+ e_activity_set_cancellable (activity, cancellable);
+ g_object_unref (cancellable);
+ }
+
e_mail_account_store_queue_enabled_services (account_store, &queue);
while (!g_queue_is_empty (&queue)) {
CamelService *service;