aboutsummaryrefslogtreecommitdiffstats
path: root/mail/e-mail-folder-utils.c
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2011-08-15 23:32:20 +0800
committerMilan Crha <mcrha@redhat.com>2011-08-15 23:32:20 +0800
commit80f4a16462a23e45a173dd1fa1ea6f9332fa9405 (patch)
tree4455baa8eebe3c3295097fc5a72b6709d162f648 /mail/e-mail-folder-utils.c
parent06d760be123616c5e3644559e5bbe4b9c91e2395 (diff)
downloadgsoc2013-evolution-80f4a16462a23e45a173dd1fa1ea6f9332fa9405.tar
gsoc2013-evolution-80f4a16462a23e45a173dd1fa1ea6f9332fa9405.tar.gz
gsoc2013-evolution-80f4a16462a23e45a173dd1fa1ea6f9332fa9405.tar.bz2
gsoc2013-evolution-80f4a16462a23e45a173dd1fa1ea6f9332fa9405.tar.lz
gsoc2013-evolution-80f4a16462a23e45a173dd1fa1ea6f9332fa9405.tar.xz
gsoc2013-evolution-80f4a16462a23e45a173dd1fa1ea6f9332fa9405.tar.zst
gsoc2013-evolution-80f4a16462a23e45a173dd1fa1ea6f9332fa9405.zip
Bug #655942 - Shows 'Storing folder...' when deleting a local folder
Diffstat (limited to 'mail/e-mail-folder-utils.c')
-rw-r--r--mail/e-mail-folder-utils.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/mail/e-mail-folder-utils.c b/mail/e-mail-folder-utils.c
index 64bdbdb821..d7d4808058 100644
--- a/mail/e-mail-folder-utils.c
+++ b/mail/e-mail-folder-utils.c
@@ -765,6 +765,12 @@ mail_folder_remove_recursive (CamelStore *store,
return success;
}
+static void
+follow_cancel_cb (GCancellable *cancellable, GCancellable *transparent_cancellable)
+{
+ g_cancellable_cancel (transparent_cancellable);
+}
+
gboolean
e_mail_folder_remove_sync (CamelFolder *folder,
GCancellable *cancellable,
@@ -776,6 +782,8 @@ e_mail_folder_remove_sync (CamelFolder *folder,
CamelStore *parent_store;
const gchar *full_name;
gboolean success = TRUE;
+ GCancellable *transparent_cancellable = NULL;
+ gulong cbid = 0;
g_return_val_if_fail (CAMEL_IS_FOLDER (folder), FALSE);
@@ -824,8 +832,18 @@ e_mail_folder_remove_sync (CamelFolder *folder,
cancellable, _("Removing folder '%s'"),
camel_folder_get_full_name (folder));
+ if (cancellable) {
+ transparent_cancellable = g_cancellable_new ();
+ cbid = g_cancellable_connect (cancellable, G_CALLBACK (follow_cancel_cb), transparent_cancellable, NULL);
+ }
+
success = mail_folder_remove_recursive (
- parent_store, to_remove, cancellable, error);
+ parent_store, to_remove, transparent_cancellable, error);
+
+ if (transparent_cancellable) {
+ g_cancellable_disconnect (cancellable, cbid);
+ g_object_unref (transparent_cancellable);
+ }
camel_operation_pop_message (cancellable);