aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-folder-search.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@helixcode.com>2000-12-02 11:55:18 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2000-12-02 11:55:18 +0800
commit787d1833c052cc1acf54a1d7fae5c350bdec4f94 (patch)
treed6408ab60d0c3f876ce04f3570ffa1e35b92206f /camel/camel-folder-search.c
parentcd372acdcf941fa20889518a4ff90180ef4f0a64 (diff)
downloadgsoc2013-evolution-787d1833c052cc1acf54a1d7fae5c350bdec4f94.tar.gz
gsoc2013-evolution-787d1833c052cc1acf54a1d7fae5c350bdec4f94.tar.zst
gsoc2013-evolution-787d1833c052cc1acf54a1d7fae5c350bdec4f94.zip
Added system_flag to CamelFolderSearchClass
2000-12-01 Jeffrey Stedfast <fejj@helixcode.com> * camel-folder-search.h: Added system_flag to CamelFolderSearchClass * camel-folder-summary.c (camel_system_flag_get): Convenience function to return whether or not a flag is set using a string as the flag name. (camel_system_flag): Return the integer value of the flag string. * camel-folder-search.c (search_system_flag): New ESExp callback for allowing vfoldering on CamelMessageInfo flags. svn path=/trunk/; revision=6763
Diffstat (limited to 'camel/camel-folder-search.c')
-rw-r--r--camel/camel-folder-search.c31
1 files changed, 29 insertions, 2 deletions
diff --git a/camel/camel-folder-search.c b/camel/camel-folder-search.c
index 0376dd9fef..f887986e3b 100644
--- a/camel/camel-folder-search.c
+++ b/camel/camel-folder-search.c
@@ -55,6 +55,7 @@ static ESExpResult *search_match_all(struct _ESExp *f, int argc, struct _ESExpTe
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_user_tag(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *s);
+static ESExpResult *search_system_flag(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *s);
static ESExpResult *search_get_sent_date(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *s);
static ESExpResult *search_get_received_date(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *s);
static ESExpResult *search_get_current_date(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *s);
@@ -77,6 +78,7 @@ camel_folder_search_class_init (CamelFolderSearchClass *klass)
klass->header_contains = search_header_contains;
klass->user_tag = search_user_tag;
klass->user_flag = search_user_flag;
+ klass->system_flag = search_system_flag;
klass->get_sent_date = search_get_sent_date;
klass->get_received_date = search_get_received_date;
klass->get_current_date = search_get_current_date;
@@ -170,9 +172,10 @@ struct {
{ "header-contains", CAMEL_STRUCT_OFFSET(CamelFolderSearchClass, header_contains), 1 },
{ "user-tag", CAMEL_STRUCT_OFFSET(CamelFolderSearchClass, user_tag), 1 },
{ "user-flag", CAMEL_STRUCT_OFFSET(CamelFolderSearchClass, user_flag), 1 },
+ { "system-flag", CAMEL_STRUCT_OFFSET(CamelFolderSearchClass, system_flag), 1 },
{ "get-sent-date", CAMEL_STRUCT_OFFSET(CamelFolderSearchClass, get_sent_date), 1 },
{ "get-received-date", CAMEL_STRUCT_OFFSET(CamelFolderSearchClass, get_received_date), 1 },
- { "get-current-date", CAMEL_STRUCT_OFFSET(CamelFolderSearchClass, get_current_date), 1 }
+ { "get-current-date", CAMEL_STRUCT_OFFSET(CamelFolderSearchClass, get_current_date), 1 },
};
void
@@ -728,7 +731,8 @@ 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)
+static ESExpResult *
+search_user_flag(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *search)
{
ESExpResult *r;
int i;
@@ -756,6 +760,29 @@ static ESExpResult *search_user_flag(struct _ESExp *f, int argc, struct _ESExpRe
return r;
}
+static ESExpResult *
+search_system_flag (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *search)
+{
+ ESExpResult *r;
+
+ r(printf ("executing system-flag\n"));
+
+ if (search->current) {
+ gboolean truth = FALSE;
+
+ if (argc == 1)
+ truth = camel_system_flag_get (search->current->flags, argv[0]->value.string);
+
+ 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;
+}
+
static ESExpResult *search_user_tag(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *search)
{
ESExpResult *r;