Bug #691477 - exists_vcard is not supported when parsing a query from string
authorMilan Crha <mcrha@redhat.com>
Fri, 11 Jan 2013 13:27:38 +0000 (14:27 +0100)
committerMilan Crha <mcrha@redhat.com>
Fri, 11 Jan 2013 13:28:40 +0000 (14:28 +0100)
addressbook/libebook/e-book-query.c

index 5cb73a2..6e5b00e 100644 (file)
@@ -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 }
 };
 
 /**