aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-component.c
diff options
context:
space:
mode:
Diffstat (limited to 'mail/mail-component.c')
-rw-r--r--mail/mail-component.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/mail/mail-component.c b/mail/mail-component.c
index 500fa35516..6d2201937a 100644
--- a/mail/mail-component.c
+++ b/mail/mail-component.c
@@ -149,8 +149,12 @@ store_info_new(CamelStore *store, const char *name)
si->name = g_strdup(name);
si->store = store;
camel_object_ref(store);
- si->vtrash = camel_store_get_trash(store, NULL);
- si->vjunk = camel_store_get_junk(store, NULL);
+ /* If these are vfolders then they need to be opened now,
+ * otherwise they wont keep track of all folders */
+ if ((store->flags & CAMEL_STORE_VTRASH) != 0)
+ si->vtrash = camel_store_get_trash(store, NULL);
+ if ((store->flags & CAMEL_STORE_VJUNK) != 0)
+ si->vjunk = camel_store_get_junk(store, NULL);
return si;
}