aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2013-11-27 23:28:55 +0800
committerMatthew Barnes <mbarnes@redhat.com>2013-11-28 02:15:08 +0800
commit8ae3cc32830179e0937b315d673d11a17658e7ac (patch)
tree8cd30a3abc8f199aab84f71d67507ee20f5d2d99 /mail
parenteedcd8118c26f2bb22cc0f8cee0fee5714efb257 (diff)
downloadgsoc2013-evolution-8ae3cc32830179e0937b315d673d11a17658e7ac.tar
gsoc2013-evolution-8ae3cc32830179e0937b315d673d11a17658e7ac.tar.gz
gsoc2013-evolution-8ae3cc32830179e0937b315d673d11a17658e7ac.tar.bz2
gsoc2013-evolution-8ae3cc32830179e0937b315d673d11a17658e7ac.tar.lz
gsoc2013-evolution-8ae3cc32830179e0937b315d673d11a17658e7ac.tar.xz
gsoc2013-evolution-8ae3cc32830179e0937b315d673d11a17658e7ac.tar.zst
gsoc2013-evolution-8ae3cc32830179e0937b315d673d11a17658e7ac.zip
Remove mail_cancel_all().
Turns out this function was a no-op, because nothing registered itself to be cancelled this way. This was part of the legacy async framework, which we've mostly moved away from now.
Diffstat (limited to 'mail')
-rw-r--r--mail/e-mail-backend.c52
1 files changed, 25 insertions, 27 deletions
diff --git a/mail/e-mail-backend.c b/mail/e-mail-backend.c
index 54e2ccbec7..e51a83eacc 100644
--- a/mail/e-mail-backend.c
+++ b/mail/e-mail-backend.c
@@ -131,33 +131,34 @@ mail_backend_prepare_for_offline_cb (EShell *shell,
GtkWindow *window;
EMailSession *session;
EMailAccountStore *account_store;
+ EShellBackend *shell_backend;
GQueue queue = G_QUEUE_INIT;
- gboolean synchronize = FALSE;
- if (e_shell_backend_is_started (E_SHELL_BACKEND (backend)))
- e_shell_backend_add_activity (E_SHELL_BACKEND (backend), activity);
+ shell_backend = E_SHELL_BACKEND (backend);
window = e_shell_get_active_window (shell);
session = e_mail_backend_get_session (backend);
account_store = e_mail_ui_session_get_account_store (E_MAIL_UI_SESSION (session));
- if (e_shell_get_network_available (shell) &&
- e_shell_backend_is_started (E_SHELL_BACKEND (backend)))
- synchronize = em_utils_prompt_user (
- window, NULL, "mail:ask-quick-offline", NULL);
+ if (e_shell_backend_is_started (shell_backend)) {
+ gboolean synchronize = FALSE;
- if (!synchronize)
- mail_cancel_all ();
+ if (e_shell_get_network_available (shell))
+ synchronize = em_utils_prompt_user (
+ window, NULL, "mail:ask-quick-offline", NULL);
- /* 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;
+ if (synchronize)
+ e_shell_backend_cancel_all (shell_backend);
+
+ if (!e_activity_get_cancellable (activity)) {
+ GCancellable *cancellable;
+
+ cancellable = camel_operation_new ();
+ e_activity_set_cancellable (activity, cancellable);
+ g_object_unref (cancellable);
+ }
- cancellable = camel_operation_new ();
- e_activity_set_cancellable (activity, cancellable);
- g_object_unref (cancellable);
+ e_shell_backend_add_activity (shell_backend, activity);
}
e_mail_account_store_queue_enabled_services (account_store, &queue);
@@ -165,15 +166,15 @@ mail_backend_prepare_for_offline_cb (EShell *shell,
CamelService *service;
service = g_queue_pop_head (&queue);
- if (service == NULL)
+
+ if (!CAMEL_IS_STORE (service))
continue;
- if (CAMEL_IS_STORE (service))
- e_mail_store_go_offline (
- CAMEL_STORE (service), G_PRIORITY_DEFAULT,
- e_activity_get_cancellable (activity),
- (GAsyncReadyCallback) mail_backend_store_operation_done_cb,
- g_object_ref (activity));
+ e_mail_store_go_offline (
+ CAMEL_STORE (service), G_PRIORITY_DEFAULT,
+ e_activity_get_cancellable (activity),
+ (GAsyncReadyCallback) mail_backend_store_operation_done_cb,
+ g_object_ref (activity));
}
}
@@ -305,9 +306,6 @@ mail_backend_prepare_for_quit_cb (EShell *shell,
mail_vfolder_shutdown ();
- /* Cancel all pending activities. */
- mail_cancel_all ();
-
list = camel_session_list_services (CAMEL_SESSION (session));
if (delete_junk) {