aboutsummaryrefslogtreecommitdiffstats
path: root/mail/component-factory.c
diff options
context:
space:
mode:
Diffstat (limited to 'mail/component-factory.c')
-rw-r--r--mail/component-factory.c53
1 files changed, 30 insertions, 23 deletions
diff --git a/mail/component-factory.c b/mail/component-factory.c
index d3a88ca197..5e3ece1f61 100644
--- a/mail/component-factory.c
+++ b/mail/component-factory.c
@@ -414,7 +414,8 @@ mail_load_storages (GNOME_Evolution_Shell shell, const GSList *sources, gboolean
const MailConfigService *service = NULL;
CamelService *store;
CamelProvider *prov;
-
+ char *name;
+
if (is_account_data) {
account = iter->data;
service = account->source;
@@ -425,9 +426,8 @@ mail_load_storages (GNOME_Evolution_Shell shell, const GSList *sources, gboolean
if (service->url == NULL || service->url[0] == '\0')
continue;
- store = camel_session_get_service (session, service->url,
- CAMEL_PROVIDER_STORE, &ex);
- if (store == NULL) {
+ prov = camel_session_get_provider (session, service->url, &ex);
+ if (prov == NULL) {
/* FIXME: real error dialog */
g_warning ("couldn't get service %s: %s\n", service->url,
camel_exception_get_description (&ex));
@@ -435,31 +435,38 @@ mail_load_storages (GNOME_Evolution_Shell shell, const GSList *sources, gboolean
continue;
}
- prov = camel_service_get_provider (store);
-
/* FIXME: this case is ambiguous for things like the
* mbox provider, which can really be a spool
* (/var/spool/mail/user) or a storage (~/mail/, eg).
* That issue can't be resolved on the provider level
* -- it's a per-URL problem.
*/
- if (prov->flags & CAMEL_PROVIDER_IS_STORAGE && prov->flags & CAMEL_PROVIDER_IS_REMOTE) {
- char *name;
-
- if (is_account_data) {
- name = g_strdup (account->name);
- } else {
- name = camel_service_get_name (store, TRUE);
- }
- add_storage (name, service->url, store, shell, &ex);
- g_free (name);
-
- if (camel_exception_is_set (&ex)) {
- /* FIXME: real error dialog */
- g_warning ("Cannot load storage: %s",
- camel_exception_get_description (&ex));
- camel_exception_clear (&ex);
- }
+ if (!(prov->flags & (CAMEL_PROVIDER_IS_STORAGE | CAMEL_PROVIDER_IS_REMOTE)))
+ continue;
+
+ store = camel_session_get_service (session, service->url,
+ CAMEL_PROVIDER_STORE, &ex);
+ if (store == NULL) {
+ /* FIXME: real error dialog */
+ g_warning ("couldn't get service %s: %s\n", service->url,
+ camel_exception_get_description (&ex));
+ camel_exception_clear (&ex);
+ continue;
+ }
+
+ if (is_account_data)
+ name = g_strdup (account->name);
+ else
+ name = camel_service_get_name (store, TRUE);
+
+ add_storage (name, service->url, store, shell, &ex);
+ g_free (name);
+
+ if (camel_exception_is_set (&ex)) {
+ /* FIXME: real error dialog */
+ g_warning ("Cannot load storage: %s",
+ camel_exception_get_description (&ex));
+ camel_exception_clear (&ex);
}
camel_object_unref (CAMEL_OBJECT (store));