diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2001-08-20 15:29:26 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2001-08-20 15:29:26 +0800 |
commit | 41dcb0c01b44af388aa51a200d411ea4fe2eeb83 (patch) | |
tree | 670f88df5b73769ae23372fc87eb5d26ee84f901 /mail/component-factory.c | |
parent | fd2c106a51f532e41b403f6df4fd1e3a201db393 (diff) | |
download | gsoc2013-evolution-41dcb0c01b44af388aa51a200d411ea4fe2eeb83.tar.gz gsoc2013-evolution-41dcb0c01b44af388aa51a200d411ea4fe2eeb83.tar.zst gsoc2013-evolution-41dcb0c01b44af388aa51a200d411ea4fe2eeb83.zip |
camel_folder_create_folder can now return a heirachial tree so subscribe
2001-08-20 Jeffrey Stedfast <fejj@ximian.com>
* component-factory.c (storage_create_folder):
camel_folder_create_folder can now return a heirachial tree so
subscribe to down the tree.
svn path=/trunk/; revision=12257
Diffstat (limited to 'mail/component-factory.c')
-rw-r--r-- | mail/component-factory.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/mail/component-factory.c b/mail/component-factory.c index f01e9147b2..21e2a5ed30 100644 --- a/mail/component-factory.c +++ b/mail/component-factory.c @@ -793,14 +793,14 @@ storage_create_folder (EvolutionStorage *storage, gpointer user_data) { CamelStore *store = user_data; + CamelFolderInfo *root, *fi; char *prefix, *name; CamelURL *url; CamelException ex; - CamelFolderInfo *fi; - + if (strcmp (type, "mail") != 0) return EVOLUTION_STORAGE_ERROR_UNSUPPORTED_TYPE; - + name = strrchr (path, '/'); if (!name++) return EVOLUTION_STORAGE_ERROR_INVALID_URI; @@ -811,10 +811,10 @@ storage_create_folder (EvolutionStorage *storage, if (!url) return EVOLUTION_STORAGE_ERROR_INVALID_URI; - fi = camel_store_create_folder (store, url->path + 1, name, &ex); + root = camel_store_create_folder (store, url->path + 1, name, &ex); camel_url_free (url); } else - fi = camel_store_create_folder (store, NULL, name, &ex); + root = camel_store_create_folder (store, NULL, name, &ex); if (camel_exception_is_set (&ex)) { /* FIXME: do better than this */ @@ -822,14 +822,16 @@ storage_create_folder (EvolutionStorage *storage, return EVOLUTION_STORAGE_ERROR_INVALID_URI; } - if (camel_store_supports_subscriptions (store)) - camel_store_subscribe_folder (store, fi->full_name, NULL); + if (camel_store_supports_subscriptions (store)) { + for (fi = root; fi; fi = fi->child) + camel_store_subscribe_folder (store, fi->full_name, NULL); + } prefix = g_strndup (path, name - path - 1); - folder_created (store, prefix, fi); + folder_created (store, prefix, root); g_free (prefix); - - camel_store_free_folder_info (store, fi); + + camel_store_free_folder_info (store, root); return EVOLUTION_STORAGE_OK; } |