From 47099e5a66a9cb8dfb3d7a99fe3d057e62af11de Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Fri, 11 Jan 2013 14:27:38 +0100 Subject: [PATCH] Bug #691477 - exists_vcard is not supported when parsing a query from string --- addressbook/libebook/e-book-query.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/addressbook/libebook/e-book-query.c b/addressbook/libebook/e-book-query.c index 5cb73a2..6e5b00e 100644 --- a/addressbook/libebook/e-book-query.c +++ b/addressbook/libebook/e-book-query.c @@ -617,6 +617,26 @@ func_exists (struct _ESExp *f, return r; } +static ESExpResult * +func_exists_vcard (struct _ESExp *f, + gint argc, + struct _ESExpResult **argv, + gpointer data) +{ + GList **list = data; + ESExpResult *r; + + if (argc == 1 + && argv[0]->type == ESEXP_RES_STRING) { + *list = g_list_prepend (*list, e_book_query_vcard_field_exists (argv[0]->value.string)); + } + + r = e_sexp_result_new (f, ESEXP_RES_BOOL); + r->value.boolean = FALSE; + + return r; +} + /* 'builtin' functions */ static const struct { const gchar *name; @@ -632,6 +652,7 @@ static const struct { { "beginswith", func_beginswith, 0 }, { "endswith", func_endswith, 0 }, { "exists", func_exists, 0 }, + { "exists_vcard", func_exists_vcard, 0 } }; /** -- 2.7.4