From fdacdc0bb9a57096680d44ff92aa24ff997bbff4 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Fri, 13 Feb 2004 19:45:31 +0000 Subject: Same. 2004-02-13 Jeffrey Stedfast * providers/imap/camel-imap-store.c (get_folder_online): Same. * providers/local/camel-mh-store.c (get_folder): Same as maildir changes. * providers/local/camel-maildir-store.c (get_folder): Make exceptions strings consistanmt with the mbox exception strings (and vise versa). Also handle the CAMEL_STORE_FOLDER_EXCL flag. * providers/local/camel-mbox-store.c (get_folder): Check CAMEL_STORE_FOLDER_EXCL flag. * providers/local/camel-local-store.c (get_folder): Simplified by using camel_mkdir instead of doing it manually. * camel-store.c (camel_store_get_folder): If the folder exists in the cache and the O_EXCL flag was passed, return NULL and set an exception. * camel-store.h: Added a new CAMEL_STORE_FOLDER_EXCL flag for use with get_folder(). svn path=/trunk/; revision=24738 --- camel/providers/local/camel-maildir-store.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'camel/providers/local/camel-maildir-store.c') diff --git a/camel/providers/local/camel-maildir-store.c b/camel/providers/local/camel-maildir-store.c index c84c37158c..0eff01f1d2 100644 --- a/camel/providers/local/camel-maildir-store.c +++ b/camel/providers/local/camel-maildir-store.c @@ -103,18 +103,19 @@ get_folder(CamelStore * store, const char *folder_name, guint32 flags, CamelExce if (stat(name, &st) == -1) { if (errno != ENOENT) { camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, - _("Could not open folder `%s':\n%s"), + _("Cannot get folder `%s': %s"), folder_name, g_strerror (errno)); } else if ((flags & CAMEL_STORE_FOLDER_CREATE) == 0) { camel_exception_setv (ex, CAMEL_EXCEPTION_STORE_NO_FOLDER, - _("Folder `%s' does not exist."), folder_name); + _("Cannot get folder `%s': folder does not exist."), + folder_name); } else { if (mkdir(name, 0700) != 0 || mkdir(tmp, 0700) != 0 || mkdir(cur, 0700) != 0 || mkdir(new, 0700) != 0) { camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, - _("Could not create folder `%s':\n%s"), + _("Cannot create folder `%s': %s"), folder_name, g_strerror (errno)); rmdir(tmp); rmdir(cur); @@ -128,8 +129,12 @@ get_folder(CamelStore * store, const char *folder_name, guint32 flags, CamelExce || stat(tmp, &st) != 0 || !S_ISDIR(st.st_mode) || stat(cur, &st) != 0 || !S_ISDIR(st.st_mode) || stat(new, &st) != 0 || !S_ISDIR(st.st_mode)) { - camel_exception_setv(ex, CAMEL_EXCEPTION_STORE_NO_FOLDER, - _("`%s' is not a maildir directory."), name); + camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM, + _("Cannot get folder `%s': not a maildir directory."), name); + } else if (flags & CAMEL_STORE_FOLDER_EXCL) { + camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, + _("Cannot create folder `%s': folder exists."), + folder_name); } else { folder = camel_maildir_folder_new(store, folder_name, flags, ex); } -- cgit v1.2.3