aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-folder.c
diff options
context:
space:
mode:
authorbertrand <bertrand@helixcode.com>2000-01-22 10:58:12 +0800
committerBertrand Guiheneuf <bertrand@src.gnome.org>2000-01-22 10:58:12 +0800
commit84423c930ecc93ce93040bfd49e20c68670d4364 (patch)
tree1eb47e691f93c353405d85a1d320442191f5f61b /camel/camel-folder.c
parente8a2fed920088141d8ed47c6803bc166b18c5418 (diff)
downloadgsoc2013-evolution-84423c930ecc93ce93040bfd49e20c68670d4364.tar.gz
gsoc2013-evolution-84423c930ecc93ce93040bfd49e20c68670d4364.tar.zst
gsoc2013-evolution-84423c930ecc93ce93040bfd49e20c68670d4364.zip
test the mbox provider.
2000-01-21 bertrand <bertrand@helixcode.com> * tests/test10.c: test the mbox provider. * camel/camel-folder.c (_set_name): if camel_folder_get_mode returns an exception, return it instead of overriding it with a new one. (camel_folder_is_open): make the is_open method public. (_set_name): use the is_open instead of get_mode. (_set_name): set the fullname even in the case where the folder has no parent. (_set_name): use %c, not %d to add the separator char into the full path. svn path=/trunk/; revision=1606
Diffstat (limited to 'camel/camel-folder.c')
-rw-r--r--camel/camel-folder.c43
1 files changed, 37 insertions, 6 deletions
diff --git a/camel/camel-folder.c b/camel/camel-folder.c
index 3b22011d55..69e1df9694 100644
--- a/camel/camel-folder.c
+++ b/camel/camel-folder.c
@@ -477,7 +477,9 @@ _set_name (CamelFolder *folder,
"name parameter is NULL");
return;
}
-
+
+ CAMEL_LOG_FULL_DEBUG ("CamelFolder::set_name, folder name is %s\n", name);
+
if (!folder->parent_store) {
camel_exception_set (ex,
@@ -486,10 +488,11 @@ _set_name (CamelFolder *folder,
return;
}
- /* the set_name method is valid only only on
+ /* the set_name method is valid only on
close folders */
- if (camel_folder_get_mode (folder, ex) != FOLDER_CLOSE) {
+ if (camel_folder_is_open (folder, ex)) {
+ if (camel_exception_get_id (ex)) return;
camel_exception_set (ex,
CAMEL_EXCEPTION_FOLDER_INVALID,
"CamelFolder::set_name is valid only on closed folders");
@@ -497,14 +500,19 @@ _set_name (CamelFolder *folder,
}
separator = camel_store_get_separator (folder->parent_store, ex);
+ if (camel_exception_get_id (ex)) return;
+
camel_exception_clear (ex);
if (folder->parent_folder) {
parent_full_name = camel_folder_get_full_name (folder->parent_folder, ex);
if (camel_exception_get_id (ex)) return;
- full_name = g_strdup_printf ("%s%d%s", parent_full_name, separator, name);
- }
-
+ full_name = g_strdup_printf ("%s%c%s", parent_full_name, separator, name);
+ } else {
+ full_name = g_strdup_printf ("%c%s", separator, name);
+ }
+
+ CAMEL_LOG_FULL_DEBUG ("CamelFolder::set_name, folder full name set to %s\n", full_name);
folder->name = g_strdup (name);
folder->full_name = full_name;
@@ -759,6 +767,29 @@ _is_open (CamelFolder *folder, CamelException *ex)
}
+/**
+ * _is_open: test if the folder is open
+ * @folder: The folder object
+ *
+ * Tests if a folder is open. If not open it can be opened
+ * CamelFolder::open
+ *
+ * Return value: true if the folder exists, false otherwise
+ **/
+gboolean
+camel_folder_is_open (CamelFolder *folder, CamelException *ex)
+{
+ if (!folder) {
+ camel_exception_set (ex,
+ CAMEL_EXCEPTION_FOLDER_NULL,
+ "folder object is NULL");
+ return FALSE;
+ }
+
+ return (CF_CLASS(folder)->is_open (folder, ex));
+}
+
+