aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNotZed <NotZed@HelixCode.com>2000-03-24 03:51:48 +0800
committerMichael Zucci <zucchi@src.gnome.org>2000-03-24 03:51:48 +0800
commiteaaa546aca76513ce1a3cf060cc1337d57efa7d8 (patch)
treedf11cdc90e126dd2728cd5842b631deed93dccad
parent6d99be7149ce15e10460f80a218b0f4333b8c4be (diff)
downloadgsoc2013-evolution-eaaa546aca76513ce1a3cf060cc1337d57efa7d8.tar
gsoc2013-evolution-eaaa546aca76513ce1a3cf060cc1337d57efa7d8.tar.gz
gsoc2013-evolution-eaaa546aca76513ce1a3cf060cc1337d57efa7d8.tar.bz2
gsoc2013-evolution-eaaa546aca76513ce1a3cf060cc1337d57efa7d8.tar.lz
gsoc2013-evolution-eaaa546aca76513ce1a3cf060cc1337d57efa7d8.tar.xz
gsoc2013-evolution-eaaa546aca76513ce1a3cf060cc1337d57efa7d8.tar.zst
gsoc2013-evolution-eaaa546aca76513ce1a3cf060cc1337d57efa7d8.zip
Changed to use async search api.
2000-03-22 NotZed <NotZed@HelixCode.com> * filter-driver.c (main): Changed to use async search api. svn path=/trunk/; revision=2153
-rw-r--r--filter/ChangeLog4
-rw-r--r--filter/filter-driver.c16
2 files changed, 19 insertions, 1 deletions
diff --git a/filter/ChangeLog b/filter/ChangeLog
index 9b2b4e2fb8..84ae5c2b37 100644
--- a/filter/ChangeLog
+++ b/filter/ChangeLog
@@ -1,3 +1,7 @@
+2000-03-22 NotZed <NotZed@HelixCode.com>
+
+ * filter-driver.c (main): Changed to use async search api.
+
2000-03-04 NotZed <NotZed@HelixCode.com>
* filter-druid.c (html_write_options): Output 'and' bits between
diff --git a/filter/filter-driver.c b/filter/filter-driver.c
index 37509d0bc9..885bf7ddd4 100644
--- a/filter/filter-driver.c
+++ b/filter/filter-driver.c
@@ -307,6 +307,13 @@ start(void)
return x;
}
+static void
+search_cb(CamelFolder *f, int id, gboolean complete, GList *matches, struct exec_context *x)
+{
+ printf("appending matches ...\n");
+ x->matches = g_list_concat(x->matches, g_list_copy(matches));
+}
+
int main(int argc, char **argv)
{
ESExp *f;
@@ -343,13 +350,18 @@ int main(int argc, char **argv)
while (options) {
struct filter_option *fo = options->data;
+ int id;
s = g_string_new("");
a = g_string_new("");
expand_filter_option(s, a, fo);
printf("searching expression %s\n", s->str);
- x->matches = camel_folder_search_by_expression (x->folder, s->str, x->ex);
+ x->matches= NULL;
+ id = camel_folder_search_by_expression (x->folder, s->str, search_cb, x, x->ex);
+
+ /* wait for it to finish */
+ camel_folder_search_complete(x->folder, id, TRUE, x->ex);
/* remove uid's for which processing is complete ... */
m = x->matches;
@@ -376,6 +388,8 @@ int main(int argc, char **argv)
g_string_free(s, TRUE);
g_string_free(a, TRUE);
+
+ g_list_free(x->matches);
options = g_list_next(options);
}