aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-folder-search.c
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2003-09-04 02:05:54 +0800
committerMichael Zucci <zucchi@src.gnome.org>2003-09-04 02:05:54 +0800
commit1d5176dbe5bb48f45e8cb9339b66d35e5df65554 (patch)
tree2c81078a7a652d2f26dfb2fde9690949d90e061c /camel/camel-folder-search.c
parent9a763746ccd9f51e37fba2ee8e68eec17622534d (diff)
downloadgsoc2013-evolution-1d5176dbe5bb48f45e8cb9339b66d35e5df65554.tar
gsoc2013-evolution-1d5176dbe5bb48f45e8cb9339b66d35e5df65554.tar.gz
gsoc2013-evolution-1d5176dbe5bb48f45e8cb9339b66d35e5df65554.tar.bz2
gsoc2013-evolution-1d5176dbe5bb48f45e8cb9339b66d35e5df65554.tar.lz
gsoc2013-evolution-1d5176dbe5bb48f45e8cb9339b66d35e5df65554.tar.xz
gsoc2013-evolution-1d5176dbe5bb48f45e8cb9339b66d35e5df65554.tar.zst
gsoc2013-evolution-1d5176dbe5bb48f45e8cb9339b66d35e5df65554.zip
** See bug #47765.
2003-08-20 Not Zed <NotZed@Ximian.com> ** See bug #47765. * camel-folder-search.h: Removed match1 member. * camel-folder-search.c (camel_folder_search_match_expression): use current directly rather than match1. This method isn't used anywhere anyway. (search_not): remove match1 stuff. (search_match_all): properly handle the match-all against 1 message as a scalar result, not an array result. 2003-09-03 Not Zed <NotZed@Ximian.com> * camel-http-stream.c (camel_http_stream_set_proxy): handle NULL proxy_url - unset the proxy. svn path=/trunk/; revision=22452
Diffstat (limited to 'camel/camel-folder-search.c')
-rw-r--r--camel/camel-folder-search.c33
1 files changed, 14 insertions, 19 deletions
diff --git a/camel/camel-folder-search.c b/camel/camel-folder-search.c
index 89fb8f1db0..bf762478b6 100644
--- a/camel/camel-folder-search.c
+++ b/camel/camel-folder-search.c
@@ -426,7 +426,7 @@ camel_folder_search_match_expression(CamelFolderSearch *search, const char *expr
GPtrArray *uids;
int ret = FALSE;
- search->match1 = (CamelMessageInfo *)info;
+ search->current = (CamelMessageInfo *)info;
uids = camel_folder_search_execute_expression(search, expr, ex);
if (uids) {
@@ -434,7 +434,7 @@ camel_folder_search_match_expression(CamelFolderSearch *search, const char *expr
ret = TRUE;
camel_folder_search_free_result(search, uids);
}
- search->match1 = NULL;
+ search->current = NULL;
return ret;
}
@@ -492,14 +492,10 @@ search_not(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSe
r->value.ptrarray = g_ptr_array_new();
/* not against a single message?*/
- if (search->match1 || search->current) {
+ if (search->current) {
int found = FALSE;
- if (search->match1)
- uid = camel_message_info_uid(search->match1);
- else
- uid = camel_message_info_uid(search->current);
-
+ uid = camel_message_info_uid(search->current);
for (i=0;!found && i<v->len;i++) {
if (strcmp(uid, v->pdata[i]) == 0)
found = TRUE;
@@ -555,33 +551,32 @@ search_match_all(struct _ESExp *f, int argc, struct _ESExpTerm **argv, CamelFold
if (argc>1) {
g_warning("match-all only takes a single argument, other arguments ignored");
}
- r = e_sexp_result_new(f, ESEXP_RES_ARRAY_PTR);
- r->value.ptrarray = g_ptr_array_new();
-
- /* we are only matching a single message? */
- if (search->match1) {
- search->current = search->match1;
+ /* we are only matching a single message? or already inside a match-all? */
+ if (search->current) {
d(printf("matching against 1 message: %s\n", camel_message_info_subject(search->current)));
+ r = e_sexp_result_new(f, ESEXP_RES_BOOL);
+ r->value.bool = FALSE;
+
if (argc>0) {
r1 = e_sexp_term_eval(f, argv[0]);
if (r1->type == ESEXP_RES_BOOL) {
- if (r1->value.bool)
- g_ptr_array_add(r->value.ptrarray, (char *)camel_message_info_uid(search->current));
+ r->value.bool = r1->value.bool;
} else {
g_warning("invalid syntax, matches require a single bool result");
e_sexp_fatal_error(f, _("(match-all) requires a single bool result"));
}
e_sexp_result_free(f, r1);
} else {
- g_ptr_array_add(r->value.ptrarray, (char *)camel_message_info_uid(search->current));
+ r->value.bool = TRUE;
}
- search->current = NULL;
-
return r;
}
+ r = e_sexp_result_new(f, ESEXP_RES_ARRAY_PTR);
+ r->value.ptrarray = g_ptr_array_new();
+
if (search->summary == NULL) {
/* TODO: make it work - e.g. use the folder and so forth for a slower search */
g_warning("No summary supplied, match-all doesn't work with no summary");