aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbertrand <Bertrand.Guiheneuf@aful.org>1999-12-22 07:17:03 +0800
committerBertrand Guiheneuf <bertrand@src.gnome.org>1999-12-22 07:17:03 +0800
commitfe17c009802b6f07df28a3c723c9520b5b8b08f7 (patch)
tree03bbe0594af041d2ca0f04c1d6e500dc912880e6
parent852dc3bc1c3310baf3831b0648773e26daa4f9aa (diff)
downloadgsoc2013-evolution-fe17c009802b6f07df28a3c723c9520b5b8b08f7.tar
gsoc2013-evolution-fe17c009802b6f07df28a3c723c9520b5b8b08f7.tar.gz
gsoc2013-evolution-fe17c009802b6f07df28a3c723c9520b5b8b08f7.tar.bz2
gsoc2013-evolution-fe17c009802b6f07df28a3c723c9520b5b8b08f7.tar.lz
gsoc2013-evolution-fe17c009802b6f07df28a3c723c9520b5b8b08f7.tar.xz
gsoc2013-evolution-fe17c009802b6f07df28a3c723c9520b5b8b08f7.tar.zst
gsoc2013-evolution-fe17c009802b6f07df28a3c723c9520b5b8b08f7.zip
part of the mbox provider.
1999-12-22 bertrand <Bertrand.Guiheneuf@aful.org> * camel/providers/mbox/camel-mbox-store.h: * camel/providers/mbox/camel-mbox-store.c: * camel/providers/mbox/camel-mbox-folder.h: * camel/providers/mbox/camel-mbox-folder.c: part of the mbox provider. svn path=/trunk/; revision=1510
-rw-r--r--ChangeLog21
-rw-r--r--camel/Makefile.am2
-rw-r--r--camel/camel-exception-list.def11
-rw-r--r--camel/camel-folder.c53
-rw-r--r--camel/providers/Makefile.am1
-rw-r--r--configure.in1
6 files changed, 61 insertions, 28 deletions
diff --git a/ChangeLog b/ChangeLog
index 78c5a8f025..c37775e095 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,24 @@
+1999-12-22 bertrand <Bertrand.Guiheneuf@aful.org>
+
+ * camel/providers/mbox/camel-mbox-store.h:
+ * camel/providers/mbox/camel-mbox-store.c:
+ * camel/providers/mbox/camel-mbox-folder.h:
+ * camel/providers/mbox/camel-mbox-folder.c:
+ part of the mbox provider.
+
+1999-12-20 bertrand <Bertrand.Guiheneuf@aful.org>
+
+ * camel/camel-folder.c (_set_name):
+ check that the folder is closed or raise an exception.
+ (_set_name): unset the name fields as soon as possible,
+ even if an exception is raised.
+
+ * configure.in:
+ build mbox provider Makefile
+
+ * camel/Makefile.am (SUBDIRS):
+ re-enable providers compilation
+
1999-12-19 Damon Chaplin <damon@karuna.freeserve.co.uk>
* configure.in (AC_OUTPUT): added widgets/meeting-time-sel/Makefile
diff --git a/camel/Makefile.am b/camel/Makefile.am
index c359645bc4..2fae06080d 100644
--- a/camel/Makefile.am
+++ b/camel/Makefile.am
@@ -1,6 +1,6 @@
## Process this file with automake to produce Makefile.in
-SUBDIRS = #providers
+SUBDIRS = providers
libcamelincludedir = $(includedir)/camel
diff --git a/camel/camel-exception-list.def b/camel/camel-exception-list.def
index f24bbdcb13..83701306a3 100644
--- a/camel/camel-exception-list.def
+++ b/camel/camel-exception-list.def
@@ -2,13 +2,14 @@ CAMEL_EXCEPTION_NONE = 0,
/* Generic exceptions */
CAMEL_EXCEPTION_INVALID_PARAM,
-
+CAMEL_EXCEPTION_SYSTEM,
/* CamelFolderException */
CAMEL_EXCEPTION_FOLDER_NULL,
-CAMEL_EXCEPTION_INVALID_FOLDER,
-CAMEL_EXCEPTION_INVALID_FOLDER_STATE,
-CAMEL_EXCEPTION_NON_EMPTY_FOLDER,
-CAMEL_EXCEPTION_NON_UID_FOLDER,
+CAMEL_EXCEPTION_FOLDER_INVALID,
+CAMEL_EXCEPTION_FOLDER_INVALID_STATE,
+CAMEL_EXCEPTION_FOLDER_NON_EMPTY,
+CAMEL_EXCEPTION_FOLDER_NON_UID,
+CAMEL_EXCEPTION_FOLDER_INSUFFICIENT_PERMISSION,
diff --git a/camel/camel-folder.c b/camel/camel-folder.c
index f22d2c0f54..2c1ed686a6 100644
--- a/camel/camel-folder.c
+++ b/camel/camel-folder.c
@@ -240,7 +240,7 @@ _init_with_store (CamelFolder *folder, CamelStore *parent_store, CamelException
if (folder->parent_store) {
camel_exception_set (ex,
- CAMEL_EXCEPTION_INVALID_FOLDER,
+ CAMEL_EXCEPTION_FOLDER_INVALID,
"folder already has a parent store");
return;
}
@@ -462,6 +462,15 @@ _set_name (CamelFolder *folder,
return;
}
+ /* if the folder already has a name, free it */
+ g_free (folder->name);
+ g_free (folder->full_name);
+
+ /* set those fields to NULL now, so that if an
+ exception occurs, they will be set anyway */
+ folder->name = NULL;
+ folder->full_name = NULL;
+
if (!name) {
camel_exception_set (ex,
CAMEL_EXCEPTION_INVALID_PARAM,
@@ -472,23 +481,23 @@ _set_name (CamelFolder *folder,
if (!folder->parent_store) {
camel_exception_set (ex,
- CAMEL_EXCEPTION_INVALID_FOLDER,
+ CAMEL_EXCEPTION_FOLDER_INVALID,
"folder has no parent store");
return;
}
- /* if the folder already has a name, free it */
- g_free (folder->name);
- g_free (folder->full_name);
-
- /* set thos fields to NULL now, so that if an
- exception occurs, they will be set anyway */
- folder->name = NULL;
- folder->full_name = NULL;
-
-
+ /* the set_name method is valid only only on
+ close folders */
+
+ if (camel_folder_get_mode (folder, ex) != FOLDER_CLOSE) {
+ camel_exception_set (ex,
+ CAMEL_EXCEPTION_FOLDER_INVALID,
+ "CamelFolder::set_name is valid only on closed folders");
+ return;
+ }
+
separator = camel_store_get_separator (folder->parent_store);
- camel_exception_free (ex);
+ 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;
@@ -780,7 +789,7 @@ _get_subfolder (CamelFolder *folder,
if (!folder->parent_store) {
camel_exception_set (ex,
- CAMEL_EXCEPTION_INVALID_FOLDER,
+ CAMEL_EXCEPTION_FOLDER_INVALID,
"folder has no parent store");
return;
}
@@ -862,14 +871,14 @@ _create (CamelFolder *folder, CamelException *ex)
if (!folder->name) {
camel_exception_set (ex,
- CAMEL_EXCEPTION_INVALID_FOLDER,
+ CAMEL_EXCEPTION_FOLDER_INVALID,
"folder has no name");
return FALSE;
}
if (!folder->parent_store) {
camel_exception_set (ex,
- CAMEL_EXCEPTION_INVALID_FOLDER,
+ CAMEL_EXCEPTION_FOLDER_INVALID,
"folder has no parent store");
return FALSE;
}
@@ -969,7 +978,7 @@ _delete (CamelFolder *folder, gboolean recurse, CamelException *ex)
/* method valid only on closed folders */
if (folder->open_state != FOLDER_CLOSE) {
- camel_exception_set (ex, CAMEL_EXCEPTION_INVALID_FOLDER_STATE,
+ camel_exception_set (ex, CAMEL_EXCEPTION_FOLDER_INVALID_STATE,
"Delete operation invalid on opened folders");
return FALSE;
}
@@ -994,7 +1003,7 @@ _delete (CamelFolder *folder, gboolean recurse, CamelException *ex)
} while (ok && (sf = sf->next));
}
} else if (subfolders) {
- camel_exception_set (ex, CAMEL_EXCEPTION_NON_EMPTY_FOLDER,
+ camel_exception_set (ex, CAMEL_EXCEPTION_FOLDER_NON_EMPTY,
"folder has subfolders");
ok = FALSE;
}
@@ -1621,7 +1630,7 @@ camel_folder_get_message_uid (CamelFolder *folder, CamelMimeMessage *message, Ca
if (!folder->has_uid_capability) {
camel_exception_set (ex,
- CAMEL_EXCEPTION_NON_UID_FOLDER,
+ CAMEL_EXCEPTION_FOLDER_NON_UID,
"folder is not UID capable");
return NULL;
}
@@ -1706,7 +1715,7 @@ camel_folder_get_message_by_uid (CamelFolder *folder, const gchar *uid, CamelEx
if (!folder->has_uid_capability) {
camel_exception_set (ex,
- CAMEL_EXCEPTION_NON_UID_FOLDER,
+ CAMEL_EXCEPTION_FOLDER_NON_UID,
"folder is not UID capable");
return NULL;
}
@@ -1726,7 +1735,7 @@ _get_uid_list (CamelFolder *folder, CamelException *ex)
if (!folder->has_uid_capability) {
camel_exception_set (ex,
- CAMEL_EXCEPTION_NON_UID_FOLDER,
+ CAMEL_EXCEPTION_FOLDER_NON_UID,
"folder is not UID capable");
return NULL;
}
@@ -1760,7 +1769,7 @@ camel_folder_get_uid_list (CamelFolder *folder, CamelException *ex)
if (!folder->has_uid_capability) {
camel_exception_set (ex,
- CAMEL_EXCEPTION_NON_UID_FOLDER,
+ CAMEL_EXCEPTION_FOLDER_NON_UID,
"folder is not UID capable");
return NULL;
}
diff --git a/camel/providers/Makefile.am b/camel/providers/Makefile.am
index 6a09262996..2ed9c0cecc 100644
--- a/camel/providers/Makefile.am
+++ b/camel/providers/Makefile.am
@@ -1,4 +1,5 @@
## Process this file with automake to produce Makefile.in
SUBDIRS = mbox
+# this ones are disabled for the moment.
# MH maildir
diff --git a/configure.in b/configure.in
index 2d7c33111a..8129a1a790 100644
--- a/configure.in
+++ b/configure.in
@@ -102,6 +102,7 @@ camel/Makefile
camel/providers/Makefile
camel/providers/MH/Makefile
camel/providers/maildir/Makefile
+camel/providers/mbox/Makefile
composer/Makefile
devel-docs/Makefile
devel-docs/camel/Makefile