Handle summary fields and fields of interest better in e-book-backend-sqlitedb.c
authorTristan Van Berkom <tristan.van.berkom@gmail.com>
Fri, 29 Jul 2011 23:28:08 +0000 (19:28 -0400)
committerTristan Van Berkom <tristan.van.berkom@gmail.com>
Wed, 3 Aug 2011 01:33:55 +0000 (21:33 -0400)
commitd33b300beb70ad425df68de9677a3403e598ad64
tree40da88b3d9bf0c38b6417eefb4b18c02ca494d6b
parent6a9e999fdced87a5bd8eadc49ee0558505f0680c
Handle summary fields and fields of interest better in e-book-backend-sqlitedb.c

This patch dramatically changes the sqlitedb cache code by introducing
a table (array of structures) describing all of the fields which should
be included in the (summary) cache. Thus, all code that treats the
summary fields by hand previously now consults the cache generically.

The REV field is added to the summary table, the UID is always returned
in any results from e_book_backend_sqlitedb_search() and when
'fields_of_interest' is specified then the sqlite3 db will only
be queried for the fields_of_interest + UID (thus only those fields
will be present in any virtually created vcard objects).

Additionally, e_book_backend_sqlitedb_get_vcard_string() and _get_contact()
take a new 'GHashTable *fields_of_interest' argument for field filtering and
e_book_backend_sqlitedb_is_summary_query() is an exported api which can be
tested before calling e_book_backend_sqlitedb_get_vcard_string().
addressbook/libedata-book/e-book-backend-sqlitedb-test.c
addressbook/libedata-book/e-book-backend-sqlitedb.c
addressbook/libedata-book/e-book-backend-sqlitedb.h