[evolution-couchdb] Take into account the query passed to get_contact_list method to make searching work
- From: Rodrigo Moya <rodrigo src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [evolution-couchdb] Take into account the query passed to get_contact_list method to make searching work
- Date: Mon, 21 Dec 2009 10:53:00 +0000 (UTC)
commit 347c08fa34c02e78f03bb93a63fe057379f33cdd
Author: Rodrigo Moya <rodrigo gnome-db org>
Date: Mon Dec 21 11:52:39 2009 +0100
Take into account the query passed to get_contact_list method to make
searching work
addressbook/e-book-backend-couchdb.c | 16 ++++++++++++++--
1 files changed, 14 insertions(+), 2 deletions(-)
---
diff --git a/addressbook/e-book-backend-couchdb.c b/addressbook/e-book-backend-couchdb.c
index a5a3c72..2ef7ef8 100644
--- a/addressbook/e-book-backend-couchdb.c
+++ b/addressbook/e-book-backend-couchdb.c
@@ -1285,8 +1285,15 @@ e_book_backend_couchdb_get_contact_list (EBookBackend *backend,
GSList *doc_list, *sl;
GList *contacts = NULL;
GError *error = NULL;
+ EBookBackendSExp *card_sexp = NULL;
EBookBackendCouchDB *couchdb_backend = E_BOOK_BACKEND_COUCHDB (backend);
+ card_sexp = e_book_backend_sexp_new (query);
+ if (!card_sexp) {
+ /* XXX this needs to be an invalid query error of some sort*/
+ return GNOME_Evolution_Addressbook_OtherError;
+ }
+
/* Get the list of documents from CouchDB */
doc_list = couchdb_list_documents (couchdb_backend->couchdb,
couchdb_backend->dbname,
@@ -1306,12 +1313,17 @@ e_book_backend_couchdb_get_contact_list (EBookBackend *backend,
continue;
vcard = vcard_from_couch_document (document);
- if (vcard != NULL)
- contacts = g_list_prepend (contacts, vcard);
+ if (vcard != NULL) {
+ if (e_book_backend_sexp_match_vcard (card_sexp, vcard))
+ contacts = g_list_prepend (contacts, vcard);
+ else
+ g_free (vcard);
+ }
g_object_unref (G_OBJECT (document));
}
+ g_object_unref (card_sexp);
couchdb_free_document_list (doc_list);
e_data_book_respond_get_contact_list (book, opid, GNOME_Evolution_Addressbook_Success, contacts);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]