aboutsummaryrefslogtreecommitdiffstats
path: root/camel
diff options
context:
space:
mode:
authorNotZed <NotZed@HelixCode.com>2000-02-29 04:10:54 +0800
committerMichael Zucci <zucchi@src.gnome.org>2000-02-29 04:10:54 +0800
commitbbbee6ba116f1df65514776657e86bc6182a0f56 (patch)
treebb1eda0ff4a2c409c429d543743389ac93ccacef /camel
parentce16b05aed027e814af0a36bd76dc49cfb22df2f (diff)
downloadgsoc2013-evolution-bbbee6ba116f1df65514776657e86bc6182a0f56.tar
gsoc2013-evolution-bbbee6ba116f1df65514776657e86bc6182a0f56.tar.gz
gsoc2013-evolution-bbbee6ba116f1df65514776657e86bc6182a0f56.tar.bz2
gsoc2013-evolution-bbbee6ba116f1df65514776657e86bc6182a0f56.tar.lz
gsoc2013-evolution-bbbee6ba116f1df65514776657e86bc6182a0f56.tar.xz
gsoc2013-evolution-bbbee6ba116f1df65514776657e86bc6182a0f56.tar.zst
gsoc2013-evolution-bbbee6ba116f1df65514776657e86bc6182a0f56.zip
No, its not a fatal error to search on a non-searchable folder, you just
2000-02-28 NotZed <NotZed@HelixCode.com> * camel-folder.c (camel_folder_search_by_expression): No, its not a fatal error to search on a non-searchable folder, you just dont get any matches. (_open): Dont open an opened folder (i dont see why this is really a bug, but what the hell ...) * providers/mbox/camel-mbox-folder.c (_init): Set search cap on. (_open): Call parent class to perform open. Remove folder-open check to parent instead. svn path=/trunk/; revision=1984
Diffstat (limited to 'camel')
-rw-r--r--camel/ChangeLog10
-rw-r--r--camel/camel-folder.c9
-rw-r--r--camel/providers/mbox/camel-mbox-folder.c16
3 files changed, 25 insertions, 10 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index 5bf9ce3ea2..37c2dbda96 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,5 +1,15 @@
2000-02-28 NotZed <NotZed@HelixCode.com>
+ * camel-folder.c (camel_folder_search_by_expression): No, its not
+ a fatal error to search on a non-searchable folder, you just dont
+ get any matches.
+ (_open): Dont open an opened folder (i dont see why this is really
+ a bug, but what the hell ...)
+
+ * providers/mbox/camel-mbox-folder.c (_init): Set search cap on.
+ (_open): Call parent class to perform open. Remove folder-open
+ check to parent instead.
+
* camel-stream-b64.c (my_read_encode): Fixed a typo.
* providers/mbox/camel-mbox-search.c: Changed to use e-sexp,
diff --git a/camel/camel-folder.c b/camel/camel-folder.c
index 5097caa295..0e2a234d06 100644
--- a/camel/camel-folder.c
+++ b/camel/camel-folder.c
@@ -274,6 +274,13 @@ _open (CamelFolder *folder,
CamelFolderOpenMode mode,
CamelException *ex)
{
+ if (folder->open_state == FOLDER_OPEN) {
+ camel_exception_set (ex,
+ CAMEL_EXCEPTION_FOLDER_INVALID_STATE,
+ "folder is already open");
+ return;
+ }
+
folder->open_state = FOLDER_OPEN;
folder->open_mode = mode;
}
@@ -1397,7 +1404,7 @@ GList *camel_folder_search_by_expression (CamelFolder *folder,
CamelException *ex)
{
g_assert (folder != NULL);
- g_assert (folder->has_search_capability);
+ g_return_val_if_fail (folder->has_search_capability, NULL);
return CF_CLASS (folder)->search_by_expression (folder, expression, ex);
}
diff --git a/camel/providers/mbox/camel-mbox-folder.c b/camel/providers/mbox/camel-mbox-folder.c
index 45390c3928..809c0cda42 100644
--- a/camel/providers/mbox/camel-mbox-folder.c
+++ b/camel/providers/mbox/camel-mbox-folder.c
@@ -196,14 +196,17 @@ _init (CamelFolder *folder, CamelStore *parent_store,
folder->can_hold_folders = TRUE;
folder->has_summary_capability = TRUE;
folder->has_uid_capability = TRUE;
+ folder->has_search_capability = TRUE;
folder->summary = camel_folder_summary_new ();
+#if 0
mbox_folder->folder_file_path = NULL;
mbox_folder->summary_file_path = NULL;
mbox_folder->folder_dir_path = NULL;
mbox_folder->index_file_path = NULL;
mbox_folder->internal_summary = NULL;
mbox_folder->uid_array = NULL;
+#endif
CAMEL_LOG_FULL_DEBUG ("Leaving CamelMboxFolder::init_with_store\n");
}
@@ -313,16 +316,11 @@ _open (CamelFolder *folder, CamelFolderOpenMode mode, CamelException *ex)
//struct dirent *dir_entry;
//struct stat stat_buf;
-
- if (folder->open_state == FOLDER_OPEN) {
- camel_exception_set (ex,
- CAMEL_EXCEPTION_FOLDER_INVALID_STATE,
- "folder is already open");
+ /* call parent class */
+ parent_class->open (folder, mode, ex);
+ if (camel_exception_get_id(ex))
return;
- }
-
-
-
+
/* get (or create) uid list */
//if (!(mbox_load_uid_list (mbox_folder) > 0))
// mbox_generate_uid_list (mbox_folder);