From: Milan Crha Date: Fri, 11 Jan 2013 13:27:38 +0000 (+0100) Subject: Bug #691477 - exists_vcard is not supported when parsing a query from string X-Git-Tag: upstream/3.7.4~21 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=47099e5a66a9cb8dfb3d7a99fe3d057e62af11de;p=platform%2Fupstream%2Fevolution-data-server.git Bug #691477 - exists_vcard is not supported when parsing a query from string --- 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 } }; /**