aboutsummaryrefslogtreecommitdiffstats
path: root/camel/providers/mbox/camel-mbox-folder.c
diff options
context:
space:
mode:
authorNotZed <NotZed@HelixCode.com>2000-05-03 07:08:20 +0800
committerMichael Zucci <zucchi@src.gnome.org>2000-05-03 07:08:20 +0800
commit0780002f95fe8af17160d76fae6dbb41c1add90d (patch)
treec0158c8f862261c031fde510cf118c6ee1b17c71 /camel/providers/mbox/camel-mbox-folder.c
parent1f7bdbf9c16ab5948ea2c8143216ea66c286d715 (diff)
downloadgsoc2013-evolution-0780002f95fe8af17160d76fae6dbb41c1add90d.tar
gsoc2013-evolution-0780002f95fe8af17160d76fae6dbb41c1add90d.tar.gz
gsoc2013-evolution-0780002f95fe8af17160d76fae6dbb41c1add90d.tar.bz2
gsoc2013-evolution-0780002f95fe8af17160d76fae6dbb41c1add90d.tar.lz
gsoc2013-evolution-0780002f95fe8af17160d76fae6dbb41c1add90d.tar.xz
gsoc2013-evolution-0780002f95fe8af17160d76fae6dbb41c1add90d.tar.zst
gsoc2013-evolution-0780002f95fe8af17160d76fae6dbb41c1add90d.zip
REmove gmime-utils.h from here.
2000-05-02 NotZed <NotZed@HelixCode.com> * camel.h: REmove gmime-utils.h from here. * providers/mbox/camel-mbox-search.[ch]: Removed. Functionally redundant. * providers/mbox/camel-mbox-folder.c (mbox_search_by_expression): Use the new CamelFolderSearch class to do the actual searching, just setup the search here. * camel-folder-search.[ch]: A helper class that providers may subclass to provide their own search functionality, or they can simply use as is, it supports body searches if an ibex is supplied, and header searches if a summary is supplied. svn path=/trunk/; revision=2762
Diffstat (limited to 'camel/providers/mbox/camel-mbox-folder.c')
-rw-r--r--camel/providers/mbox/camel-mbox-folder.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/camel/providers/mbox/camel-mbox-folder.c b/camel/providers/mbox/camel-mbox-folder.c
index 0b776db81c..7a0151f515 100644
--- a/camel/providers/mbox/camel-mbox-folder.c
+++ b/camel/providers/mbox/camel-mbox-folder.c
@@ -40,7 +40,6 @@
#include "string-utils.h"
#include "camel-stream-fs.h"
#include "camel-mbox-summary.h"
-#include "camel-mbox-search.h"
#include "camel-data-wrapper.h"
#include "camel-mime-message.h"
@@ -82,6 +81,8 @@ static const gchar *_get_message_uid (CamelFolder *folder, CamelMimeMessage *mes
GPtrArray *summary_get_message_info (CamelFolder *folder, int first, int count);
static const CamelMessageInfo *mbox_summary_get_by_uid(CamelFolder *f, const char *uid);
+static GList *mbox_search_by_expression(CamelFolder *folder, const char *expression, CamelException *ex);
+
static void mbox_finalize (GtkObject *object);
static void
@@ -114,7 +115,7 @@ camel_mbox_folder_class_init (CamelMboxFolderClass *camel_mbox_folder_class)
#endif
camel_folder_class->get_message_by_uid = mbox_get_message_by_uid;
- camel_folder_class->search_by_expression = camel_mbox_folder_search_by_expression;
+ camel_folder_class->search_by_expression = mbox_search_by_expression;
camel_folder_class->get_message_info = summary_get_message_info;
camel_folder_class->summary_get_by_uid = mbox_summary_get_by_uid;
@@ -187,6 +188,7 @@ mbox_init (CamelFolder *folder, CamelStore *parent_store,
CAMEL_MESSAGE_SEEN;
mbox_folder->summary = NULL;
+ mbox_folder->search = NULL;
/* now set the name info */
g_free (mbox_folder->folder_file_path);
@@ -247,6 +249,9 @@ mbox_close (CamelFolder *folder, gboolean expunge, CamelException *ex)
camel_mbox_summary_save (mbox_folder->summary);
camel_mbox_summary_unref (mbox_folder->summary);
mbox_folder->summary = NULL;
+ if (mbox_folder->search)
+ gtk_object_unref((GtkObject *)mbox_folder->search);
+ mbox_folder->search = NULL;
}
@@ -945,3 +950,19 @@ mbox_summary_get_by_uid(CamelFolder *f, const char *uid)
return (CamelMessageInfo *)camel_mbox_summary_uid(mbox_folder->summary, uid);
}
+static GList *
+mbox_search_by_expression(CamelFolder *folder, const char *expression, CamelException *ex)
+{
+ CamelMboxFolder *mbox_folder = (CamelMboxFolder *)folder;
+
+ if (mbox_folder->search == NULL) {
+ mbox_folder->search = camel_folder_search_new();
+ }
+
+ camel_folder_search_set_folder(mbox_folder->search, folder);
+ if (mbox_folder->summary)
+ camel_folder_search_set_summary(mbox_folder->search, mbox_folder->summary->messages);
+ camel_folder_search_set_body_index(mbox_folder->search, mbox_folder->index);
+
+ return camel_folder_search_execute_expression(mbox_folder->search, expression, ex);
+}