[evolution-data-server/openismus-work] sqlitedb: Properly restore vCards from summary



commit 5fd3d0a908e50c72b55fd57debf40eb6dc33eb63
Author: Mathias Hasselmann <mathias openismus com>
Date:   Fri Dec 14 01:38:37 2012 +0100

    sqlitedb: Properly restore vCards from summary
    
    VCards didn't get restored properly from summary in indirect access (D-Bus)
    mode when only id and rev fields were requested. Reason was that our code and
    SQLite had different ideas upon how to spell the revision column's name.
    
    This issue didn't affect the direct access mode, as this mode entirely ignores
    the requested fields list and always provides the full contact.

 .../libedata-book/e-book-backend-sqlitedb.c        |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/addressbook/libedata-book/e-book-backend-sqlitedb.c b/addressbook/libedata-book/e-book-backend-sqlitedb.c
index 5a5fc12..bb87c44 100644
--- a/addressbook/libedata-book/e-book-backend-sqlitedb.c
+++ b/addressbook/libedata-book/e-book-backend-sqlitedb.c
@@ -2139,13 +2139,13 @@ summary_select_stmt (GHashTable *fields_of_interest,
 	GString   *string;
 
 	if (distinct)
-		string = g_string_new ("SELECT DISTINCT summary.uid");
+		string = g_string_new ("SELECT DISTINCT summary.uid AS uid");
 	else
-		string = g_string_new ("SELECT summary.uid");
+		string = g_string_new ("SELECT summary.uid AS uid");
 
 	/* Add the E_CONTACT_REV field if they are both requested */
 	if (g_hash_table_size (fields_of_interest) == 2)
-		g_string_append (string, ", Rev");
+		g_string_append (string, ", summary.rev AS rev");
 
 	return g_string_free (string, FALSE);
 }
@@ -2173,7 +2173,7 @@ store_data_to_vcard (gpointer ref,
 			e_contact_set (contact, E_CONTACT_UID, cols[i]);
 
 			search_data->uid = g_strdup (cols[i]);
-		} else if (!strcmp (name[i], "Rev")) {
+		} else if (!strcmp (name[i], "rev")) {
 			e_contact_set (contact, E_CONTACT_REV, cols[i]);
 		} else if (!strcmp (name[i], "bdata"))
 			search_data->bdata = g_strdup (cols[i]);



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