[evolution-data-server] Bug #691477 - exists_vcard is not supported when parsing a query from string



commit 47099e5a66a9cb8dfb3d7a99fe3d057e62af11de
Author: Milan Crha <mcrha redhat com>
Date:   Fri Jan 11 14:27:38 2013 +0100

    Bug #691477 - exists_vcard is not supported when parsing a query from string

 addressbook/libebook/e-book-query.c |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)
---
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 }
 };
 
 /**



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]