[evolution-couchdb] Use contacts record API from desktopcouch-glib



commit ba7bf251e5c96d7e8d712f6587c0b9c9b701829c
Author: Rodrigo Moya <rodrigo gnome-db org>
Date:   Wed Jan 27 14:26:19 2010 +0100

    Use contacts record API from desktopcouch-glib

 addressbook/e-book-backend-couchdb.c |  175 +++++++++++++++++-----------------
 1 files changed, 88 insertions(+), 87 deletions(-)
---
diff --git a/addressbook/e-book-backend-couchdb.c b/addressbook/e-book-backend-couchdb.c
index d1531d2..398b45a 100644
--- a/addressbook/e-book-backend-couchdb.c
+++ b/addressbook/e-book-backend-couchdb.c
@@ -43,11 +43,11 @@ vcard_from_couch_document (CouchdbDocument *document)
 	GList *attr_list;
 	CouchdbStructField *app_annotations;
 
-	if (!couchdb_document_is_contact (document))
+	if (!desktopcouch_document_is_contact (document))
 		return NULL;
 
 	/* Check if the contact is marked for deletion */
-	if ((app_annotations = couchdb_document_get_application_annotations (document))) {
+	if ((app_annotations = desktopcouch_document_get_application_annotations (document))) {
 		CouchdbStructField *u1_annotations;
 
 		u1_annotations = couchdb_struct_field_get_struct_field (
@@ -73,42 +73,42 @@ vcard_from_couch_document (CouchdbDocument *document)
 
 	e_contact_set (contact, E_CONTACT_UID, (const gpointer) couchdb_document_get_id (document));
 	e_contact_set (contact, E_CONTACT_GIVEN_NAME,
-		       (const gpointer) couchdb_document_contact_get_first_name (document));
+		       (const gpointer) desktopcouch_document_contact_get_first_name (document));
 	e_contact_set (contact, E_CONTACT_FAMILY_NAME,
-		       (const gpointer) couchdb_document_contact_get_last_name (document));
+		       (const gpointer) desktopcouch_document_contact_get_last_name (document));
 	e_contact_set (contact, E_CONTACT_NICKNAME,
-		       (const gpointer) couchdb_document_contact_get_nick_name (document));
+		       (const gpointer) desktopcouch_document_contact_get_nick_name (document));
 	e_contact_set (contact, E_CONTACT_SPOUSE,
-		       (const gpointer) couchdb_document_contact_get_spouse_name (document));
+		       (const gpointer) desktopcouch_document_contact_get_spouse_name (document));
 
 	e_contact_set (contact, E_CONTACT_ORG,
-		       (const gpointer) couchdb_document_contact_get_company (document));
+		       (const gpointer) desktopcouch_document_contact_get_company (document));
 	e_contact_set (contact, E_CONTACT_ORG_UNIT,
-		       (const gpointer) couchdb_document_contact_get_department (document));
+		       (const gpointer) desktopcouch_document_contact_get_department (document));
 	e_contact_set (contact, E_CONTACT_TITLE,
-		       (const gpointer) couchdb_document_contact_get_title (document));
+		       (const gpointer) desktopcouch_document_contact_get_title (document));
 	e_contact_set (contact, E_CONTACT_ROLE,
-		       (const gpointer) couchdb_document_contact_get_job_title (document));
+		       (const gpointer) desktopcouch_document_contact_get_job_title (document));
 	e_contact_set (contact, E_CONTACT_MANAGER,
-		       (const gpointer) couchdb_document_contact_get_manager_name (document));
+		       (const gpointer) desktopcouch_document_contact_get_manager_name (document));
 	e_contact_set (contact, E_CONTACT_ASSISTANT,
-		       (const gpointer) couchdb_document_contact_get_assistant_name (document));
+		       (const gpointer) desktopcouch_document_contact_get_assistant_name (document));
 	e_contact_set (contact, E_CONTACT_OFFICE,
-		       (const gpointer) couchdb_document_contact_get_office (document));
+		       (const gpointer) desktopcouch_document_contact_get_office (document));
 	e_contact_set (contact, E_CONTACT_NOTE,
-		       (const gpointer) couchdb_document_contact_get_notes (document));
+		       (const gpointer) desktopcouch_document_contact_get_notes (document));
 
 	/* parse email addresses */
 	attr_list = NULL;
 
-	list = couchdb_document_contact_get_email_addresses (document);
+	list = desktopcouch_document_contact_get_email_addresses (document);
 	while (list != NULL) {
 		const char *email_str, *description_str, *uuid_str;
 		EVCardAttribute *attr;
 		CouchdbStructField *email_address = (CouchdbStructField *) list->data;
 
-		email_str = couchdb_document_contact_email_get_address (email_address);
-		description_str = couchdb_document_contact_email_get_description (email_address);
+		email_str = desktopcouch_document_contact_email_get_address (email_address);
+		description_str = desktopcouch_document_contact_email_get_description (email_address);
 		uuid_str = couchdb_struct_field_get_uuid (email_address);
 
 		attr = e_vcard_attribute_new (NULL, e_contact_vcard_attribute (E_CONTACT_EMAIL));
@@ -147,14 +147,14 @@ vcard_from_couch_document (CouchdbDocument *document)
 	}
 
 	/* parse phone numbers */
-	list = couchdb_document_contact_get_phone_numbers (document);
+	list = desktopcouch_document_contact_get_phone_numbers (document);
 	while (list != NULL) {
 		const char *phone_str, *description_str, *uuid_str;
 		EVCardAttribute *attr;
 		CouchdbStructField *phone_number = (CouchdbStructField *) list->data;
 
-		phone_str = couchdb_document_contact_phone_get_number (phone_number);
-		description_str = couchdb_document_contact_phone_get_description (phone_number);
+		phone_str = desktopcouch_document_contact_phone_get_number (phone_number);
+		description_str = desktopcouch_document_contact_phone_get_description (phone_number);
 		uuid_str = couchdb_struct_field_get_uuid (phone_number);
 
 		if (description_str != NULL) {
@@ -259,7 +259,7 @@ vcard_from_couch_document (CouchdbDocument *document)
 	}
 
 	/* parse postal addresses */
-	list = couchdb_document_contact_get_addresses (document);
+	list = desktopcouch_document_contact_get_addresses (document);
 	while (list != NULL) {
 		char **street_lines;
 		const char *description_str;
@@ -269,22 +269,22 @@ vcard_from_couch_document (CouchdbDocument *document)
 		contact_address = g_new0 (EContactAddress, 1);
 		contact_address->address_format = g_strdup ("");
 
-		street_lines = g_strsplit (couchdb_document_contact_address_get_street (address), "\n", 2);
+		street_lines = g_strsplit (desktopcouch_document_contact_address_get_street (address), "\n", 2);
 		if (street_lines != NULL) {
 			contact_address->street = g_strdup (street_lines[0]);
 			if (street_lines[1] != NULL)
 				contact_address->ext = g_strdup (street_lines[1]);
 			g_strfreev (street_lines);
 		} else
-			contact_address->street = g_strdup (couchdb_document_contact_address_get_street (address));
+			contact_address->street = g_strdup (desktopcouch_document_contact_address_get_street (address));
 
-		contact_address->locality = g_strdup (couchdb_document_contact_address_get_city (address));
-		contact_address->region = g_strdup (couchdb_document_contact_address_get_state (address));
-		contact_address->country = g_strdup (couchdb_document_contact_address_get_country (address));
-		contact_address->code = g_strdup (couchdb_document_contact_address_get_postalcode (address));
-		contact_address->po = g_strdup (couchdb_document_contact_address_get_pobox (address));
+		contact_address->locality = g_strdup (desktopcouch_document_contact_address_get_city (address));
+		contact_address->region = g_strdup (desktopcouch_document_contact_address_get_state (address));
+		contact_address->country = g_strdup (desktopcouch_document_contact_address_get_country (address));
+		contact_address->code = g_strdup (desktopcouch_document_contact_address_get_postalcode (address));
+		contact_address->po = g_strdup (desktopcouch_document_contact_address_get_pobox (address));
 		
-		description_str = couchdb_document_contact_address_get_description (address);
+		description_str = desktopcouch_document_contact_address_get_description (address);
 		if (!g_ascii_strcasecmp (description_str, "home"))
 			e_contact_set (contact, E_CONTACT_ADDRESS_HOME, (const gpointer) contact_address);
 		else if (!g_ascii_strcasecmp (description_str, "work"))
@@ -300,14 +300,14 @@ vcard_from_couch_document (CouchdbDocument *document)
 	}
 
 	/* parse URLs */
-	list = couchdb_document_contact_get_urls (document);
+	list = desktopcouch_document_contact_get_urls (document);
 	while (list != NULL) {
 		const char *description_str, *address_str, *uuid_str;
 		EVCardAttribute *attr;
 		CouchdbStructField *url = (CouchdbStructField *) list->data;
 
-		address_str = couchdb_document_contact_url_get_address (url);
-		description_str = couchdb_document_contact_url_get_description (url);
+		address_str = desktopcouch_document_contact_url_get_address (url);
+		description_str = desktopcouch_document_contact_url_get_description (url);
 		uuid_str = couchdb_struct_field_get_uuid (url);
 
 		if (description_str != NULL) {
@@ -334,15 +334,15 @@ vcard_from_couch_document (CouchdbDocument *document)
 	}
 
 	/* parse IM addresses */
-	list = couchdb_document_contact_get_im_addresses (document);
+	list = desktopcouch_document_contact_get_im_addresses (document);
 	while (list != NULL) {
 		const char *address_str, *description_str, *protocol_str, *uuid_str;
 		EVCardAttribute *attr = NULL;
 		CouchdbStructField *im = (CouchdbStructField *) list->data;
 
-		address_str = couchdb_document_contact_im_get_address (im);
-		description_str = couchdb_document_contact_im_get_description (im);
-		protocol_str = couchdb_document_contact_im_get_protocol (im);
+		address_str = desktopcouch_document_contact_im_get_address (im);
+		description_str = desktopcouch_document_contact_im_get_description (im);
+		protocol_str = desktopcouch_document_contact_im_get_protocol (im);
 		/* Some records don't have the 'protocol' field, and use the
 		   'description' field to specify the kind of IM address this
 		   refers to */
@@ -351,21 +351,21 @@ vcard_from_couch_document (CouchdbDocument *document)
 		uuid_str = couchdb_struct_field_get_uuid (im);
 
 		if (protocol_str != NULL) {
-			if (g_strcmp0 (protocol_str, COUCHDB_DOCUMENT_CONTACT_IM_PROTOCOL_AIM) == 0)
+			if (g_strcmp0 (protocol_str, DESKTOPCOUCH_DOCUMENT_CONTACT_IM_PROTOCOL_AIM) == 0)
 				attr = e_vcard_attribute_new (NULL, e_contact_vcard_attribute (E_CONTACT_IM_AIM));
-			else if (g_strcmp0 (protocol_str, COUCHDB_DOCUMENT_CONTACT_IM_PROTOCOL_GADU_GADU) == 0)
+			else if (g_strcmp0 (protocol_str, DESKTOPCOUCH_DOCUMENT_CONTACT_IM_PROTOCOL_GADU_GADU) == 0)
 				attr = e_vcard_attribute_new (NULL, e_contact_vcard_attribute (E_CONTACT_IM_GADUGADU));
-			else if (g_strcmp0 (protocol_str, COUCHDB_DOCUMENT_CONTACT_IM_PROTOCOL_GROUPWISE) == 0)
+			else if (g_strcmp0 (protocol_str, DESKTOPCOUCH_DOCUMENT_CONTACT_IM_PROTOCOL_GROUPWISE) == 0)
 				attr = e_vcard_attribute_new (NULL, e_contact_vcard_attribute (E_CONTACT_IM_GROUPWISE));
-			else if (g_strcmp0 (protocol_str, COUCHDB_DOCUMENT_CONTACT_IM_PROTOCOL_ICQ) == 0)
+			else if (g_strcmp0 (protocol_str, DESKTOPCOUCH_DOCUMENT_CONTACT_IM_PROTOCOL_ICQ) == 0)
 				attr = e_vcard_attribute_new (NULL, e_contact_vcard_attribute (E_CONTACT_IM_ICQ));
-			else if (g_strcmp0 (protocol_str, COUCHDB_DOCUMENT_CONTACT_IM_PROTOCOL_JABBER) == 0)
+			else if (g_strcmp0 (protocol_str, DESKTOPCOUCH_DOCUMENT_CONTACT_IM_PROTOCOL_JABBER) == 0)
 				attr = e_vcard_attribute_new (NULL, e_contact_vcard_attribute (E_CONTACT_IM_JABBER));
-			else if (g_strcmp0 (protocol_str, COUCHDB_DOCUMENT_CONTACT_IM_PROTOCOL_MSN) == 0)
+			else if (g_strcmp0 (protocol_str, DESKTOPCOUCH_DOCUMENT_CONTACT_IM_PROTOCOL_MSN) == 0)
 				attr = e_vcard_attribute_new (NULL, e_contact_vcard_attribute (E_CONTACT_IM_MSN));
-			else if (g_strcmp0 (protocol_str, COUCHDB_DOCUMENT_CONTACT_IM_PROTOCOL_SKYPE) == 0)
+			else if (g_strcmp0 (protocol_str, DESKTOPCOUCH_DOCUMENT_CONTACT_IM_PROTOCOL_SKYPE) == 0)
 				attr = e_vcard_attribute_new (NULL, e_contact_vcard_attribute (E_CONTACT_IM_SKYPE));
-			else if (g_strcmp0 (protocol_str, COUCHDB_DOCUMENT_CONTACT_IM_PROTOCOL_YAHOO) == 0)
+			else if (g_strcmp0 (protocol_str, DESKTOPCOUCH_DOCUMENT_CONTACT_IM_PROTOCOL_YAHOO) == 0)
 				attr = e_vcard_attribute_new (NULL, e_contact_vcard_attribute (E_CONTACT_IM_YAHOO));
 
 			if (attr != NULL) {
@@ -399,7 +399,7 @@ vcard_from_couch_document (CouchdbDocument *document)
 	}
 
 	/* birth date */
-	str = (char *) couchdb_document_contact_get_birth_date (document);
+	str = (char *) desktopcouch_document_contact_get_birth_date (document);
 	if (str && strlen (str) > 0) {
 		EContactDate *dt;
 
@@ -411,7 +411,7 @@ vcard_from_couch_document (CouchdbDocument *document)
 	}
 
 	/* wedding date */
-	str = (char *) couchdb_document_contact_get_wedding_date (document);
+	str = (char *) desktopcouch_document_contact_get_wedding_date (document);
 	if (str && strlen (str)) {
 		EContactDate *dt;
 
@@ -424,7 +424,7 @@ vcard_from_couch_document (CouchdbDocument *document)
 
 	/* application annotations */
 	if (couchdb_document_has_field (document, "application_annotations")) {
-		CouchdbStructField *annotations = couchdb_document_get_application_annotations (document);
+		CouchdbStructField *annotations = desktopcouch_document_get_application_annotations (document);
 
 		str = couchdb_struct_field_to_string (annotations);
 		e_vcard_add_attribute_with_value (E_VCARD (contact),
@@ -456,7 +456,7 @@ contact_email_to_struct_field (EVCardAttribute *attr)
 
 	params = e_vcard_attribute_get_params (attr);
 	if (!params)
-		return couchdb_document_contact_email_new (NULL, email, NULL);
+		return desktopcouch_document_contact_email_new (NULL, email, NULL);
 
 	for (pl = params; pl != NULL; pl = pl->next) {
 		GList *v;
@@ -481,7 +481,7 @@ contact_email_to_struct_field (EVCardAttribute *attr)
 		}
 	}
 
-	return couchdb_document_contact_email_new (uuid, email, description);
+	return desktopcouch_document_contact_email_new (uuid, email, description);
 }
 
 static CouchdbStructField *
@@ -499,7 +499,7 @@ contact_phone_to_struct_field (EVCardAttribute *attr)
 
 	params = e_vcard_attribute_get_params (attr);
 	if (!params)
-		return couchdb_document_contact_phone_new (NULL, phone, NULL, /* FIXME */ 0);
+		return desktopcouch_document_contact_phone_new (NULL, phone, NULL, /* FIXME */ 0);
 
 	for (pl = params; pl != NULL; pl = pl->next) {
 		GList *v;
@@ -548,7 +548,7 @@ contact_phone_to_struct_field (EVCardAttribute *attr)
 	else
 		final_description = g_strdup_printf ("%s %s", description, kind);
 
-	sf = couchdb_document_contact_phone_new (uuid, phone, final_description, /* FIXME */ 0);
+	sf = desktopcouch_document_contact_phone_new (uuid, phone, final_description, /* FIXME */ 0);
 	g_free (final_description);
 
 	return sf;
@@ -569,7 +569,7 @@ contact_postal_address_to_struct_field (EContact *contact, EContactField field,
 		else if (contact_address->street && *contact_address->street)
 			street = g_strdup (contact_address->street);
 
-		sf = couchdb_document_contact_address_new (/* FIXME */ NULL,
+		sf = desktopcouch_document_contact_address_new (/* FIXME */ NULL,
 							   street,
 							   contact_address->locality,
 							   contact_address->region,
@@ -597,7 +597,7 @@ contact_url_to_struct_field (EVCardAttribute *attr, const gchar *description)
 
 	params = e_vcard_attribute_get_params (attr);
 	if (!params)
-		return couchdb_document_contact_url_new (NULL, address, description);
+		return desktopcouch_document_contact_url_new (NULL, address, description);
 
 	for (pl = params; pl != NULL; pl = pl->next) {
 		GList *v;
@@ -610,7 +610,7 @@ contact_url_to_struct_field (EVCardAttribute *attr, const gchar *description)
 		}
 	}
 
-	return couchdb_document_contact_url_new (uuid, address, description);
+	return desktopcouch_document_contact_url_new (uuid, address, description);
 }
 
 static CouchdbStructField *
@@ -625,7 +625,7 @@ contact_im_to_struct_field (EVCardAttribute *attr, const gchar *protocol)
 
 	params = e_vcard_attribute_get_params (attr);
 	if (!params)
-		return couchdb_document_contact_im_new (NULL, address, "other", protocol);
+		return desktopcouch_document_contact_im_new (NULL, address, "other", protocol);
 
 	for (pl = params; pl != NULL; pl = pl->next) {
 		GList *v;
@@ -648,7 +648,7 @@ contact_im_to_struct_field (EVCardAttribute *attr, const gchar *protocol)
 		}
 	}
 
-	return couchdb_document_contact_im_new (uuid, address, description, protocol);
+	return desktopcouch_document_contact_im_new (uuid, address, description, protocol);
 }
 
 static CouchdbDocument *
@@ -663,7 +663,7 @@ couch_document_from_contact (EBookBackendCouchDB *couchdb_backend, EContact *con
 	CouchdbStructField *postal_address;
 
 	/* create the CouchDBDocument to put on the database */
-	document = couchdb_document_contact_new (couchdb_backend->couchdb);
+	document = desktopcouch_document_contact_new (couchdb_backend->couchdb);
 
 	str = e_contact_get_const (contact, E_CONTACT_UID);
 	if (str)
@@ -673,19 +673,19 @@ couch_document_from_contact (EBookBackendCouchDB *couchdb_backend, EContact *con
 	if (str)
 		couchdb_document_set_revision (document, str);
 
-	couchdb_document_contact_set_first_name (document, (const char *) e_contact_get_const (contact, E_CONTACT_GIVEN_NAME));
-	couchdb_document_contact_set_last_name (document, (const char *) e_contact_get_const (contact, E_CONTACT_FAMILY_NAME));
-	couchdb_document_contact_set_nick_name (document, (const char *) e_contact_get_const (contact, E_CONTACT_NICKNAME));
-	couchdb_document_contact_set_spouse_name (document, (const char *) e_contact_get_const (contact, E_CONTACT_SPOUSE));
+	desktopcouch_document_contact_set_first_name (document, (const char *) e_contact_get_const (contact, E_CONTACT_GIVEN_NAME));
+	desktopcouch_document_contact_set_last_name (document, (const char *) e_contact_get_const (contact, E_CONTACT_FAMILY_NAME));
+	desktopcouch_document_contact_set_nick_name (document, (const char *) e_contact_get_const (contact, E_CONTACT_NICKNAME));
+	desktopcouch_document_contact_set_spouse_name (document, (const char *) e_contact_get_const (contact, E_CONTACT_SPOUSE));
 
-	couchdb_document_contact_set_company (document, (const char *) e_contact_get_const (contact, E_CONTACT_ORG));
-	couchdb_document_contact_set_department (document, (const char *) e_contact_get_const (contact, E_CONTACT_ORG_UNIT));
-	couchdb_document_contact_set_title (document, (const char *) e_contact_get_const (contact, E_CONTACT_TITLE));
-	couchdb_document_contact_set_job_title (document, (const char *) e_contact_get_const (contact, E_CONTACT_ROLE));
-	couchdb_document_contact_set_manager_name (document, (const char *) e_contact_get_const (contact, E_CONTACT_MANAGER));
-	couchdb_document_contact_set_assistant_name (document, (const char *) e_contact_get_const (contact, E_CONTACT_ASSISTANT));
-	couchdb_document_contact_set_office (document, (const char *) e_contact_get_const (contact, E_CONTACT_OFFICE));
-	couchdb_document_contact_set_notes (document, (const char *) e_contact_get_const (contact, E_CONTACT_NOTE));
+	desktopcouch_document_contact_set_company (document, (const char *) e_contact_get_const (contact, E_CONTACT_ORG));
+	desktopcouch_document_contact_set_department (document, (const char *) e_contact_get_const (contact, E_CONTACT_ORG_UNIT));
+	desktopcouch_document_contact_set_title (document, (const char *) e_contact_get_const (contact, E_CONTACT_TITLE));
+	desktopcouch_document_contact_set_job_title (document, (const char *) e_contact_get_const (contact, E_CONTACT_ROLE));
+	desktopcouch_document_contact_set_manager_name (document, (const char *) e_contact_get_const (contact, E_CONTACT_MANAGER));
+	desktopcouch_document_contact_set_assistant_name (document, (const char *) e_contact_get_const (contact, E_CONTACT_ASSISTANT));
+	desktopcouch_document_contact_set_office (document, (const char *) e_contact_get_const (contact, E_CONTACT_OFFICE));
+	desktopcouch_document_contact_set_notes (document, (const char *) e_contact_get_const (contact, E_CONTACT_NOTE));
 
 	/* email addresses */
 	list = NULL;
@@ -700,7 +700,7 @@ couch_document_from_contact (EBookBackendCouchDB *couchdb_backend, EContact *con
 	}
 
 	if (list) {
-		couchdb_document_contact_set_email_addresses (document, list);
+		desktopcouch_document_contact_set_email_addresses (document, list);
 
 		g_slist_foreach (list, (GFunc) couchdb_struct_field_unref, NULL);
 		g_slist_free (list);
@@ -721,7 +721,7 @@ couch_document_from_contact (EBookBackendCouchDB *couchdb_backend, EContact *con
 	}
 
 	if (list) {
-		couchdb_document_contact_set_phone_numbers (document, list);
+		desktopcouch_document_contact_set_phone_numbers (document, list);
 
 		g_slist_foreach (list, (GFunc) couchdb_struct_field_unref, NULL);
 		g_slist_free (list);
@@ -742,7 +742,7 @@ couch_document_from_contact (EBookBackendCouchDB *couchdb_backend, EContact *con
 		list = g_slist_append (list, postal_address);
 
 	if (list) {
-		couchdb_document_contact_set_addresses (document, list);
+		desktopcouch_document_contact_set_addresses (document, list);
 
 		g_slist_foreach (list, (GFunc) couchdb_struct_field_unref, NULL);
 		g_slist_free (list);
@@ -767,7 +767,7 @@ couch_document_from_contact (EBookBackendCouchDB *couchdb_backend, EContact *con
 	}
 
 	if (list != NULL) {
-		couchdb_document_contact_set_urls (document, list);
+		desktopcouch_document_contact_set_urls (document, list);
 
 		g_slist_foreach (list, (GFunc) couchdb_struct_field_unref, NULL);
 		g_slist_free (list);
@@ -782,35 +782,35 @@ couch_document_from_contact (EBookBackendCouchDB *couchdb_backend, EContact *con
 
 		if (g_strcmp0 (e_vcard_attribute_get_name (attr),
 			       e_contact_vcard_attribute (E_CONTACT_IM_AIM)) == 0)
-			sf = contact_im_to_struct_field (attr, COUCHDB_DOCUMENT_CONTACT_IM_PROTOCOL_AIM);
+			sf = contact_im_to_struct_field (attr, DESKTOPCOUCH_DOCUMENT_CONTACT_IM_PROTOCOL_AIM);
 		else if (g_strcmp0 (e_vcard_attribute_get_name (attr),
 			       e_contact_vcard_attribute (E_CONTACT_IM_GADUGADU)) == 0)
-			sf = contact_im_to_struct_field (attr, COUCHDB_DOCUMENT_CONTACT_IM_PROTOCOL_GADU_GADU);
+			sf = contact_im_to_struct_field (attr, DESKTOPCOUCH_DOCUMENT_CONTACT_IM_PROTOCOL_GADU_GADU);
 		else if (g_strcmp0 (e_vcard_attribute_get_name (attr),
 			       e_contact_vcard_attribute (E_CONTACT_IM_GROUPWISE)) == 0)
-			sf = contact_im_to_struct_field (attr, COUCHDB_DOCUMENT_CONTACT_IM_PROTOCOL_GROUPWISE);
+			sf = contact_im_to_struct_field (attr, DESKTOPCOUCH_DOCUMENT_CONTACT_IM_PROTOCOL_GROUPWISE);
 		else if (g_strcmp0 (e_vcard_attribute_get_name (attr),
 			       e_contact_vcard_attribute (E_CONTACT_IM_ICQ)) == 0)
-			sf = contact_im_to_struct_field (attr, COUCHDB_DOCUMENT_CONTACT_IM_PROTOCOL_ICQ);
+			sf = contact_im_to_struct_field (attr, DESKTOPCOUCH_DOCUMENT_CONTACT_IM_PROTOCOL_ICQ);
 		else if (g_strcmp0 (e_vcard_attribute_get_name (attr),
 			       e_contact_vcard_attribute (E_CONTACT_IM_JABBER)) == 0)
-			sf = contact_im_to_struct_field (attr, COUCHDB_DOCUMENT_CONTACT_IM_PROTOCOL_JABBER);
+			sf = contact_im_to_struct_field (attr, DESKTOPCOUCH_DOCUMENT_CONTACT_IM_PROTOCOL_JABBER);
 		else if (g_strcmp0 (e_vcard_attribute_get_name (attr),
 			       e_contact_vcard_attribute (E_CONTACT_IM_MSN)) == 0)
-			sf = contact_im_to_struct_field (attr, COUCHDB_DOCUMENT_CONTACT_IM_PROTOCOL_MSN);
+			sf = contact_im_to_struct_field (attr, DESKTOPCOUCH_DOCUMENT_CONTACT_IM_PROTOCOL_MSN);
 		else if (g_strcmp0 (e_vcard_attribute_get_name (attr),
 			       e_contact_vcard_attribute (E_CONTACT_IM_SKYPE)) == 0)
-			sf = contact_im_to_struct_field (attr, COUCHDB_DOCUMENT_CONTACT_IM_PROTOCOL_SKYPE);
+			sf = contact_im_to_struct_field (attr, DESKTOPCOUCH_DOCUMENT_CONTACT_IM_PROTOCOL_SKYPE);
 		else if (g_strcmp0 (e_vcard_attribute_get_name (attr),
 			       e_contact_vcard_attribute (E_CONTACT_IM_YAHOO)) == 0)
-			sf = contact_im_to_struct_field (attr, COUCHDB_DOCUMENT_CONTACT_IM_PROTOCOL_YAHOO);
+			sf = contact_im_to_struct_field (attr, DESKTOPCOUCH_DOCUMENT_CONTACT_IM_PROTOCOL_YAHOO);
 
 		if (sf != NULL)
 			list = g_slist_append (list, sf);
 	}
 
 	if (list != NULL) {
-		couchdb_document_contact_set_im_addresses (document, list);
+		desktopcouch_document_contact_set_im_addresses (document, list);
 
 		g_slist_foreach (list, (GFunc) couchdb_struct_field_unref, NULL);
 		g_slist_free (list);
@@ -821,7 +821,7 @@ couch_document_from_contact (EBookBackendCouchDB *couchdb_backend, EContact *con
 	if (dt) {
 		char *dt_str = e_contact_date_to_string (dt);
 		if (dt_str != NULL) {
-			couchdb_document_contact_set_birth_date (document, (const char *) dt_str);
+			desktopcouch_document_contact_set_birth_date (document, (const char *) dt_str);
 
 			g_free (dt_str);
 		}
@@ -832,7 +832,7 @@ couch_document_from_contact (EBookBackendCouchDB *couchdb_backend, EContact *con
 	if (dt) {
 		char *dt_str = e_contact_date_to_string (dt);
 		if (dt_str != NULL) {
-			couchdb_document_contact_set_wedding_date (document, (const char *) dt_str);
+			desktopcouch_document_contact_set_wedding_date (document, (const char *) dt_str);
 
 			g_free (dt_str);
 		}
@@ -845,7 +845,7 @@ couch_document_from_contact (EBookBackendCouchDB *couchdb_backend, EContact *con
 
 		annotations = couchdb_struct_field_new_from_string (str);
 		if (annotations) {
-			couchdb_document_set_application_annotations (document, annotations);
+			desktopcouch_document_set_application_annotations (document, annotations);
 			couchdb_struct_field_unref (annotations);
 		}
 	}
@@ -1071,7 +1071,7 @@ e_book_backend_couchdb_remove_contacts (EBookBackend *backend,
 
 				/* For desktopcouch, we don't remove contacts, we just
 				 * mark them as deleted */
-				app_annotations = couchdb_document_get_application_annotations (document);
+				app_annotations = desktopcouch_document_get_application_annotations (document);
 				if (app_annotations == NULL)
 					app_annotations = couchdb_struct_field_new ();
 
@@ -1086,7 +1086,7 @@ e_book_backend_couchdb_remove_contacts (EBookBackend *backend,
 				couchdb_struct_field_set_boolean_field (private_annotations, "deleted", TRUE);
 				couchdb_struct_field_set_struct_field (u1_annotations, "private_application_annotations", private_annotations);
 				couchdb_struct_field_set_struct_field (app_annotations, "Ubuntu One", u1_annotations);
-				couchdb_document_set_application_annotations (document, app_annotations);
+				desktopcouch_document_set_application_annotations (document, app_annotations);
 
 				/* Now put the new revision of the document */
 				if (couchdb_document_put (document, couchdb_backend->dbname, &error))
@@ -1358,6 +1358,7 @@ e_book_backend_couchdb_get_supported_fields (EBookBackend *backend,
 	fields = g_list_append (fields, g_strdup (e_contact_field_name (E_CONTACT_BIRTH_DATE)));
 	fields = g_list_append (fields, g_strdup (e_contact_field_name (E_CONTACT_ANNIVERSARY)));
 	fields = g_list_append (fields, g_strdup (e_contact_field_name (E_CONTACT_NOTE)));
+	fields = g_list_append (fields, g_strdup (e_contact_field_name (E_CONTACT_CATEGORIES)));
 
 	/* URLS */
 	fields = g_list_append (fields, g_strdup (e_contact_field_name (E_CONTACT_HOMEPAGE_URL)));



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