aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2012-01-10 22:49:27 +0800
committerMilan Crha <mcrha@redhat.com>2012-01-10 22:49:27 +0800
commitf2994d54460e8467a525851bd92941730b548914 (patch)
tree60873034e4c14503a15652e060bd22e32bdf6a70
parent11c24dac12bddd5ab14fdea64e71cdd6758945a3 (diff)
downloadgsoc2013-evolution-f2994d54460e8467a525851bd92941730b548914.tar.gz
gsoc2013-evolution-f2994d54460e8467a525851bd92941730b548914.tar.zst
gsoc2013-evolution-f2994d54460e8467a525851bd92941730b548914.zip
mail-folder-cache: Update folders only on stores whose support it
-rw-r--r--mail/mail-folder-cache.c43
1 files changed, 29 insertions, 14 deletions
diff --git a/mail/mail-folder-cache.c b/mail/mail-folder-cache.c
index 722016c51b..4092ee6861 100644
--- a/mail/mail-folder-cache.c
+++ b/mail/mail-folder-cache.c
@@ -959,6 +959,19 @@ ping_cb (MailFolderCache *cache)
return TRUE;
}
+static gboolean
+store_has_folder_hierarchy (CamelStore *store)
+{
+ CamelProvider *provider;
+
+ g_return_val_if_fail (store != NULL, FALSE);
+
+ provider = camel_service_get_provider (CAMEL_SERVICE (store));
+ g_return_val_if_fail (provider != NULL, FALSE);
+
+ return (provider->flags & (CAMEL_PROVIDER_IS_STORAGE | CAMEL_PROVIDER_IS_EXTERNAL)) != 0;
+}
+
static void
store_go_online_cb (CamelStore *store,
GAsyncResult *result,
@@ -971,13 +984,14 @@ store_go_online_cb (CamelStore *store,
if (g_hash_table_lookup (ud->cache->priv->stores, store) != NULL &&
!g_cancellable_is_cancelled (ud->cancellable)) {
/* We're already in the store update list. */
- camel_store_get_folder_info (
- store, NULL,
- CAMEL_STORE_FOLDER_INFO_FAST |
- CAMEL_STORE_FOLDER_INFO_RECURSIVE |
- CAMEL_STORE_FOLDER_INFO_SUBSCRIBED,
- G_PRIORITY_DEFAULT, ud->cancellable,
- (GAsyncReadyCallback) update_folders, ud);
+ if (store_has_folder_hierarchy (store))
+ camel_store_get_folder_info (
+ store, NULL,
+ CAMEL_STORE_FOLDER_INFO_FAST |
+ CAMEL_STORE_FOLDER_INFO_RECURSIVE |
+ CAMEL_STORE_FOLDER_INFO_SUBSCRIBED,
+ G_PRIORITY_DEFAULT, ud->cancellable,
+ (GAsyncReadyCallback) update_folders, ud);
} else {
/* The store vanished, that means we were probably cancelled,
* or at any rate, need to clean ourselves up. */
@@ -1633,13 +1647,14 @@ mail_folder_cache_note_store (MailFolderCache *cache,
}
} else {
normal_setup:
- camel_store_get_folder_info (
- store, NULL,
- CAMEL_STORE_FOLDER_INFO_FAST |
- CAMEL_STORE_FOLDER_INFO_RECURSIVE |
- CAMEL_STORE_FOLDER_INFO_SUBSCRIBED,
- G_PRIORITY_DEFAULT, cancellable,
- (GAsyncReadyCallback) update_folders, ud);
+ if (store_has_folder_hierarchy (store))
+ camel_store_get_folder_info (
+ store, NULL,
+ CAMEL_STORE_FOLDER_INFO_FAST |
+ CAMEL_STORE_FOLDER_INFO_RECURSIVE |
+ CAMEL_STORE_FOLDER_INFO_SUBSCRIBED,
+ G_PRIORITY_DEFAULT, cancellable,
+ (GAsyncReadyCallback) update_folders, ud);
}
g_queue_push_tail (&si->folderinfo_updates, ud);