From 285c6727853e4a5db88dde8ff300dbfc13ea176e Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Wed, 29 Jan 2014 20:01:22 +0100 Subject: Avoid multiple save of folder changes on application quit While looking at bug #721286, I found out that mail_shell_view_prepare_for_quit_cb calls a sync of the folder changes to the server, but mail_backend_prepare_for_quit_cb does the same thing (or even more, because it calls to synchronize changes in all folders), thus the former is redundant and can be dropped. --- modules/mail/e-mail-shell-view-private.c | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/modules/mail/e-mail-shell-view-private.c b/modules/mail/e-mail-shell-view-private.c index 618351a8d6..7b0460d2cb 100644 --- a/modules/mail/e-mail-shell-view-private.c +++ b/modules/mail/e-mail-shell-view-private.c @@ -494,19 +494,11 @@ mail_shell_view_reader_update_actions_cb (EMailReader *reader, e_mail_reader_update_actions (E_MAIL_READER (mail_shell_content), state); } -static void -mail_shell_view_prepare_for_quit_done_cb (CamelFolder *folder, - gpointer user_data) -{ - g_object_unref (E_ACTIVITY (user_data)); -} - static void mail_shell_view_prepare_for_quit_cb (EMailShellView *mail_shell_view, EActivity *activity) { EMailShellContent *mail_shell_content; - CamelFolder *folder; EMailReader *reader; EMailView *mail_view; GtkWidget *message_list; @@ -519,18 +511,11 @@ mail_shell_view_prepare_for_quit_cb (EMailShellView *mail_shell_view, mail_view = e_mail_shell_content_get_mail_view (mail_shell_content); reader = E_MAIL_READER (mail_view); - folder = e_mail_reader_ref_folder (reader); message_list = e_mail_reader_get_message_list (reader); - message_list_save_state (MESSAGE_LIST (message_list)); - if (folder != NULL) { - mail_sync_folder ( - folder, TRUE, - mail_shell_view_prepare_for_quit_done_cb, - g_object_ref (activity)); - g_object_unref (folder); - } + /* Do not sync folder content here, it's duty of EMailBackend, + which does it for all accounts */ } static void -- cgit v1.2.3