aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-folder-search.c
diff options
context:
space:
mode:
authorNotZed <NotZed@HelixCode.com>2000-05-19 06:40:24 +0800
committerMichael Zucci <zucchi@src.gnome.org>2000-05-19 06:40:24 +0800
commit1ff07425c1e2963f7fe835ac4be2c725f12827f5 (patch)
treee0da79df08b334a0ee0ccdcd7e1d52fb2397a3d0 /camel/camel-folder-search.c
parent8eb6a561ab9013d3ad12599176c077c57f12ce08 (diff)
downloadgsoc2013-evolution-1ff07425c1e2963f7fe835ac4be2c725f12827f5.tar
gsoc2013-evolution-1ff07425c1e2963f7fe835ac4be2c725f12827f5.tar.gz
gsoc2013-evolution-1ff07425c1e2963f7fe835ac4be2c725f12827f5.tar.bz2
gsoc2013-evolution-1ff07425c1e2963f7fe835ac4be2c725f12827f5.tar.lz
gsoc2013-evolution-1ff07425c1e2963f7fe835ac4be2c725f12827f5.tar.xz
gsoc2013-evolution-1ff07425c1e2963f7fe835ac4be2c725f12827f5.tar.zst
gsoc2013-evolution-1ff07425c1e2963f7fe835ac4be2c725f12827f5.zip
Guess!
2000-05-18 NotZed <NotZed@HelixCode.com> * providers/vee/camel-vee-folder.c: Guess! * camel-folder-search.c (search_user_flag): Implement user_flag search term. * camel-folder-search.h: Added user_flag search capability (user-flag "blah") * providers/mbox/camel-mbox-folder.c (mbox_init): Set USER flag in permanent flags for the folder. svn path=/trunk/; revision=3122
Diffstat (limited to 'camel/camel-folder-search.c')
-rw-r--r--camel/camel-folder-search.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/camel/camel-folder-search.c b/camel/camel-folder-search.c
index e5110d1d1a..b6332c5656 100644
--- a/camel/camel-folder-search.c
+++ b/camel/camel-folder-search.c
@@ -40,6 +40,7 @@ struct _CamelFolderSearchPrivate {
static ESExpResult *search_header_contains(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *search);
static ESExpResult *search_match_all(struct _ESExp *f, int argc, struct _ESExpTerm **argv, CamelFolderSearch *search);
static ESExpResult *search_body_contains(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *search);
+static ESExpResult *search_user_flag(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *s);
static ESExpResult *search_dummy(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *search);
@@ -89,6 +90,7 @@ camel_folder_search_class_init (CamelFolderSearchClass *klass)
klass->match_all = search_match_all;
klass->body_contains = search_body_contains;
klass->header_contains = search_header_contains;
+ klass->user_flag = search_user_flag;
gtk_object_class_add_signals (object_class, signals, LAST_SIGNAL);
}
@@ -133,6 +135,7 @@ struct {
{ "match-all", GTK_STRUCT_OFFSET(CamelFolderSearchClass, match_all), 3 },
{ "body-contains", GTK_STRUCT_OFFSET(CamelFolderSearchClass, body_contains), 1 },
{ "header-contains", GTK_STRUCT_OFFSET(CamelFolderSearchClass, header_contains), 1 },
+ { "user-flag", GTK_STRUCT_OFFSET(CamelFolderSearchClass, user_flag), 1 },
};
void
@@ -463,3 +466,31 @@ search_body_contains(struct _ESExp *f, int argc, struct _ESExpResult **argv, Cam
return r;
}
+
+static ESExpResult *search_user_flag(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *search)
+{
+ ESExpResult *r;
+ int i;
+
+ r(printf("executing header-contains\n"));
+
+ /* are we inside a match-all? */
+ if (search->current) {
+ int truth = FALSE;
+ /* performs an OR of all words */
+ for (i=0;i<argc && !truth;i++) {
+ if (argv[i]->type == ESEXP_RES_STRING
+ && camel_flag_get(&search->current->user_flags, argv[i]->value.string)) {
+ truth = TRUE;
+ break;
+ }
+ }
+ r = e_sexp_result_new(ESEXP_RES_BOOL);
+ r->value.bool = truth;
+ } else {
+ r = e_sexp_result_new(ESEXP_RES_ARRAY_PTR);
+ r->value.ptrarray = g_ptr_array_new();
+ }
+
+ return r;
+}