[evolution-data-server] IMAP - Do not update folder list when the operation was cancelled
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server] IMAP - Do not update folder list when the operation was cancelled
- Date: Thu, 6 Sep 2012 06:32:21 +0000 (UTC)
commit dc6d7698f2f42715d6417f6d0744cd7b7b4964c7
Author: Milan Crha <mcrha redhat com>
Date: Thu Sep 6 08:31:42 2012 +0200
IMAP - Do not update folder list when the operation was cancelled
camel/providers/imap/camel-imap-store.c | 13 +++++++++++--
1 files changed, 11 insertions(+), 2 deletions(-)
---
diff --git a/camel/providers/imap/camel-imap-store.c b/camel/providers/imap/camel-imap-store.c
index 41a4ba4..d43ac45 100644
--- a/camel/providers/imap/camel-imap-store.c
+++ b/camel/providers/imap/camel-imap-store.c
@@ -2777,6 +2777,9 @@ get_folders_sync (CamelImapStore *imap_store,
CamelImapStoreNamespace *ns;
gboolean success = TRUE, first_namespace = TRUE;
+ if (g_cancellable_is_cancelled (cancellable))
+ return FALSE;
+
/* We do a LIST followed by LSUB, and merge the results. LSUB may not be a strict
* subset of LIST for some servers, so we can't use either or separately */
present = g_hash_table_new (folder_hash, folder_eq);
@@ -2784,7 +2787,9 @@ get_folders_sync (CamelImapStore *imap_store,
if (!pattern)
pattern = "";
- for (ns = imap_store->summary->namespace; ns; ns = ns->next, first_namespace = FALSE) {
+ for (ns = imap_store->summary->namespace;
+ ns && !g_cancellable_is_cancelled (cancellable);
+ ns = ns->next, first_namespace = FALSE) {
for (k = 0; k < 2; k++) {
gchar *tmp = NULL;
@@ -2850,6 +2855,9 @@ get_folders_sync (CamelImapStore *imap_store,
}
}
+ if (g_cancellable_is_cancelled (cancellable))
+ goto fail;
+
/* Sync summary to match */
/* FIXME: we need to emit folder_create/subscribed/etc events for any new folders */
@@ -2993,7 +3001,8 @@ refresh_refresh (CamelSession *session,
/* look in all namespaces */
get_folders_sync (store, NULL, cancellable, error);
- camel_store_summary_save (CAMEL_STORE_SUMMARY (store->summary));
+ if (!g_cancellable_is_cancelled (cancellable))
+ camel_store_summary_save (CAMEL_STORE_SUMMARY (store->summary));
done:
camel_operation_pop_message (cancellable);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]