diff options
author | Dan Winship <danw@src.gnome.org> | 2001-02-15 05:51:33 +0800 |
---|---|---|
committer | Dan Winship <danw@src.gnome.org> | 2001-02-15 05:51:33 +0800 |
commit | 7d76ff550168871217e6d483f965ce430427c536 (patch) | |
tree | 86afc5a45c2b45f79587093267d680704d5d836c /camel/camel-store.c | |
parent | 3245f9dacf18e68ed5e1bc18226d0ffe65c7bf6c (diff) | |
download | gsoc2013-evolution-7d76ff550168871217e6d483f965ce430427c536.tar.gz gsoc2013-evolution-7d76ff550168871217e6d483f965ce430427c536.tar.zst gsoc2013-evolution-7d76ff550168871217e6d483f965ce430427c536.zip |
New method to create a folder when you don't know its full name.
* camel-store.c (camel_store_create_folder): New method to create
a folder when you don't know its full name.
* providers/imap/camel-imap-store.c (create_folder): Implement.
svn path=/trunk/; revision=8231
Diffstat (limited to 'camel/camel-store.c')
-rw-r--r-- | camel/camel-store.c | 42 |
1 files changed, 41 insertions, 1 deletions
diff --git a/camel/camel-store.c b/camel/camel-store.c index e7bd25a4be..bc86a72232 100644 --- a/camel/camel-store.c +++ b/camel/camel-store.c @@ -42,6 +42,10 @@ static CamelFolder *get_folder (CamelStore *store, const char *folder_name, guint32 flags, CamelException *ex); static CamelFolder *get_inbox (CamelStore *store, CamelException *ex); +static CamelFolderInfo *create_folder (CamelStore *store, + const char *parent_name, + const char *folder_name, + CamelException *ex); static void delete_folder (CamelStore *store, const char *folder_name, CamelException *ex); static void rename_folder (CamelStore *store, const char *old_name, @@ -68,6 +72,7 @@ camel_store_class_init (CamelStoreClass *camel_store_class) camel_store_class->compare_folder_name = g_str_equal; camel_store_class->get_folder = get_folder; camel_store_class->get_inbox = get_inbox; + camel_store_class->create_folder = create_folder; camel_store_class->delete_folder = delete_folder; camel_store_class->rename_folder = rename_folder; camel_store_class->sync = store_sync; @@ -211,6 +216,42 @@ camel_store_get_folder (CamelStore *store, const char *folder_name, guint32 flag } +static CamelFolderInfo * +create_folder (CamelStore *store, const char *parent_name, + const char *folder_name, CamelException *ex) +{ + g_warning ("CamelStore::create_folder not implemented for `%s'", + camel_type_to_name (CAMEL_OBJECT_GET_TYPE (store))); + return NULL; +} + +/** + * camel_store_create_folder: + * @store: a CamelStore + * @parent_name: name of the new folder's parent, or %NULL + * @folder_name: name of the folder to create + * @ex: a CamelException + * + * Creates a new folder as a child of an existing folder. + * @parent_name can be %NULL to create a new top-level folder. + * + * Return value: info about the created folder, which the caller must + * free with camel_store_free_folder_info(). + **/ +CamelFolderInfo * +camel_store_create_folder (CamelStore *store, const char *parent_name, + const char *folder_name, CamelException *ex) +{ + CamelFolderInfo *fi; + + CAMEL_STORE_LOCK(store, folder_lock); + fi = CS_CLASS (store)->create_folder (store, parent_name, folder_name, ex); + CAMEL_STORE_UNLOCK(store, folder_lock); + + return fi; +} + + static void delete_folder (CamelStore *store, const char *folder_name, CamelException *ex) { @@ -232,7 +273,6 @@ camel_store_delete_folder (CamelStore *store, const char *folder_name, CamelExce CAMEL_STORE_LOCK(store, folder_lock); CS_CLASS (store)->delete_folder (store, folder_name, ex); CAMEL_STORE_UNLOCK(store, folder_lock); - } |