[evolution-data-server/openismus-work] Customize the default system addressbook



commit e766249affc07ab1e8295db3096c1ae1406d849c
Author: Tristan Van Berkom <tristanvb openismus com>
Date:   Tue May 28 17:36:27 2013 +0900

    Customize the default system addressbook
    
    This patch modifies data/sources/system-address-book.source.in
    so that it has a customized summary optimized for person names
    and phone numbers.
    
    This customization adds the following fields to the summary
    with prefix indexes (for optimized SQLite queries):
    
     E_CONTACT_FULL_NAME, E_CONTACT_FAMILY_NAME, E_CONTACT_NICKNAME,
     E_CONTACT_GIVEN_NAME, E_CONTACT_TEL
    
    Additionally, the E_CONTACT_TEL field is configured to store the
    normalized phone number data in SQLite in order to optimize the
    phone number queries such as E_BOOK_QUERY_EQUALS_PHONE_NUMBER.
    
    The code to achieve the same configuration is as follows:
    
    e_source_backend_summary_setup_set_summary_fields (
                setup,
                E_CONTACT_FULL_NAME,
                E_CONTACT_FAMILY_NAME,
                E_CONTACT_NICKNAME,
                E_CONTACT_GIVEN_NAME,
                E_CONTACT_TEL,
                0);
    e_source_backend_summary_setup_set_indexed_fields (
                setup,
                E_CONTACT_FULL_NAME, E_BOOK_INDEX_PREFIX,
                E_CONTACT_FAMILY_NAME, E_BOOK_INDEX_PREFIX,
                E_CONTACT_NICKNAME, E_BOOK_INDEX_PREFIX,
                E_CONTACT_GIVEN_NAME, E_BOOK_INDEX_PREFIX,
                E_CONTACT_TEL, E_BOOK_INDEX_PREFIX,
                E_CONTACT_TEL, E_BOOK_INDEX_PHONE,
                0);

 data/sources/system-address-book.source.in |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/data/sources/system-address-book.source.in b/data/sources/system-address-book.source.in
index f1cea75..d218c11 100644
--- a/data/sources/system-address-book.source.in
+++ b/data/sources/system-address-book.source.in
@@ -7,3 +7,7 @@ Parent=local-stub
 [Address Book]
 BackendName=local
 Color=#becedd
+
+[Backend Summary Setup]
+SummaryFields=full_name:family_name:nickname:given_name:phone
+IndexedFields=full_name,prefix:family_name,prefix:nickname,prefix:given_name,prefix:phone,prefix:phone,phone


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