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);
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;
}
}
+ 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 */
/* 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);