diff options
Diffstat (limited to 'mail')
-rw-r--r-- | mail/mail-folder-cache.c | 43 |
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); |