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.
This commit is contained in:
Matthew Barnes
2013-11-27 10:28:55 -05:00
parent eedcd8118c
commit 8ae3cc3283
5 changed files with 25 additions and 54 deletions

View File

@ -363,7 +363,6 @@ mail_msg_main_loop_push
mail_msg_unordered_push
mail_msg_fast_ordered_push
mail_msg_slow_ordered_push
mail_cancel_all
mail_get_password
mail_in_main_thread
mail_call_t

View File

@ -306,21 +306,6 @@ mail_msg_active (void)
/* **************************************** */
static GHookList cancel_hook_list;
void
mail_cancel_all (void)
{
camel_operation_cancel_all ();
g_mutex_lock (&mail_msg_lock);
if (cancel_hook_list.is_setup)
g_hook_list_invoke (&cancel_hook_list, FALSE);
g_mutex_unlock (&mail_msg_lock);
}
static guint idle_source_id = 0;
G_LOCK_DEFINE_STATIC (idle_source_id);
static GAsyncQueue *main_loop_queue = NULL;

View File

@ -99,9 +99,6 @@ void mail_msg_unordered_push (gpointer msg);
void mail_msg_fast_ordered_push (gpointer msg);
void mail_msg_slow_ordered_push (gpointer msg);
/* To implement the stop button */
void mail_cancel_all (void);
/* Call a function in the GUI thread, wait for it to return, type is
* the marshaller to use. FIXME This thing is horrible, please put
* it out of its misery. */

View File

@ -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);
cancellable = camel_operation_new ();
e_activity_set_cancellable (activity, cancellable);
g_object_unref (cancellable);
if (!e_activity_get_cancellable (activity)) {
GCancellable *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) {

View File

@ -1367,14 +1367,6 @@ action_mail_stop_cb (GtkAction *action,
shell_view = E_SHELL_VIEW (mail_shell_view);
shell_backend = e_shell_view_get_shell_backend (shell_view);
/* XXX There's some overlap here: activities submitted through
* the legacy MailMsg system might be cancelled twice, but
* it shouldn't cause problems. */
/* the old way */
mail_cancel_all ();
/* the new way */
e_shell_backend_cancel_all (shell_backend);
}