diff options
author | Not Zed <NotZed@HelixCode.com> | 2000-08-08 11:42:47 +0800 |
---|---|---|
committer | Michael Zucci <zucchi@src.gnome.org> | 2000-08-08 11:42:47 +0800 |
commit | a7943ce5a42ef266579e60ce272c9ee3f547be03 (patch) | |
tree | 666f8f813f3cf48449bb155b577462f011377f21 /camel/camel-store.c | |
parent | ac94f697a5cf1842244984a4c1d2859118916aa2 (diff) | |
download | gsoc2013-evolution-a7943ce5a42ef266579e60ce272c9ee3f547be03.tar.gz gsoc2013-evolution-a7943ce5a42ef266579e60ce272c9ee3f547be03.tar.zst gsoc2013-evolution-a7943ce5a42ef266579e60ce272c9ee3f547be03.zip |
Only retry another uid if we had a name clash, otherwise fail.
2000-08-07 Not Zed <NotZed@HelixCode.com>
* providers/mh/camel-mh-folder.c (mh_append_message): Only retry
another uid if we had a name clash, otherwise fail.
2000-08-04 Not Zed <NotZed@HelixCode.com>
* camel-url.c (camel_url_set_protocol):
(camel_url_set_host):
(camel_url_set_path):
(camel_url_set_port): Url editing functions.
2000-08-02 Not Zed <NotZed@HelixCode.com>
* providers/mh/camel-mh-summary.c (camel_mh_summary_sync): Expunge
from the end, so the index isn't messed up when you remove a
message.
* providers/mh/camel-mh-folder.c (mh_append_message): Fix a bug
where it would never open an output file/uid.
* providers/mbox/camel-mbox-store.c (rename_folder):
Implementation for mbox as well.
* camel-store.c (camel_store_rename_folder): New method to rename folders.
(rename_folder): Default implementation.
* providers/mh/camel-mh-store.c (delete_folder): Implement this.
(rename_folder): Implement a rename operation.
svn path=/trunk/; revision=4590
Diffstat (limited to 'camel/camel-store.c')
-rw-r--r-- | camel/camel-store.c | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/camel/camel-store.c b/camel/camel-store.c index d729bf10e7..3be983e081 100644 --- a/camel/camel-store.c +++ b/camel/camel-store.c @@ -38,6 +38,8 @@ static CamelFolder *get_folder (CamelStore *store, const char *folder_name, gboolean create, CamelException *ex); static void delete_folder (CamelStore *store, const char *folder_name, CamelException *ex); +static void rename_folder (CamelStore *store, const char *old_name, + const char *new_name, CamelException *ex); static char *get_folder_name (CamelStore *store, const char *folder_name, CamelException *ex); @@ -62,6 +64,7 @@ camel_store_class_init (CamelStoreClass *camel_store_class) /* virtual method definition */ camel_store_class->get_folder = get_folder; camel_store_class->delete_folder = delete_folder; + camel_store_class->rename_folder = rename_folder; camel_store_class->get_folder_name = get_folder_name; camel_store_class->get_root_folder_name = get_root_folder_name; camel_store_class->get_default_folder_name = get_default_folder_name; @@ -138,6 +141,16 @@ delete_folder (CamelStore *store, const char *folder_name, CamelException *ex) gtk_type_name (GTK_OBJECT_TYPE (store))); } +static void rename_folder (CamelStore *store, const char *old_name, + const char *new_name, CamelException *ex) +{ + g_warning ("CamelStore::rename_folder not implemented for `%s'", + gtk_type_name (GTK_OBJECT_TYPE (store))); + camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM, + "rename folder unimplemented for: %s", + gtk_type_name (GTK_OBJECT_TYPE (store))); +} + /* CamelStore::get_folder_name should: * a) make sure that the provided name is valid @@ -287,6 +300,33 @@ camel_store_delete_folder (CamelStore *store, const char *folder_name, } } +/** + * camel_store_rename_folder: + * @store: + * @old_name: + * @new_name: + * @ex: + * + * Rename a named folder to a new name. + **/ +void camel_store_rename_folder (CamelStore *store, + const char *old_name, + const char *new_name, + CamelException *ex) +{ + char *old, *new; + + old = CS_CLASS (store)->get_folder_name(store, old_name, ex); + if (old) { + new = CS_CLASS (store)->get_folder_name(store, new_name, ex); + if (new) { + CS_CLASS (store)->rename_folder(store, old, new, ex); + g_free(new); + } + g_free(old); + } +} + /** * camel_store_get_root_folder: return the top-level folder |