[evolution-couchdb] Update to latest API changes in couchdb-glib



commit 6dea490f2972b0efa3164bd49334272bd02d8fef
Author: Rodrigo Moya <rodrigo gnome-db org>
Date:   Wed Jul 7 16:04:40 2010 +0200

    Update to latest API changes in couchdb-glib

 addressbook/e-book-backend-couchdb.c |  186 +++++++++++++++++-----------------
 1 files changed, 93 insertions(+), 93 deletions(-)
---
diff --git a/addressbook/e-book-backend-couchdb.c b/addressbook/e-book-backend-couchdb.c
index 4cbc0c0..fb3d707 100644
--- a/addressbook/e-book-backend-couchdb.c
+++ b/addressbook/e-book-backend-couchdb.c
@@ -56,11 +56,11 @@ contact_from_couch_document (CouchdbDocument *document)
 	CouchdbStructField *app_annotations;
 	EContactName contact_name;
 
-	if (!desktopcouch_document_is_contact (DESKTOPCOUCH_DOCUMENT (document)))
+	if (!couchdb_document_is_contact (document))
 		return NULL;
 
 	/* Check if the contact is marked for deletion */
-	if ((app_annotations = desktopcouch_document_get_application_annotations (DESKTOPCOUCH_DOCUMENT (document)))) {
+	if ((app_annotations = couchdb_document_get_application_annotations (document))) {
 		CouchdbStructField *u1_annotations;
 
 		u1_annotations = couchdb_struct_field_get_struct_field (
@@ -87,11 +87,11 @@ contact_from_couch_document (CouchdbDocument *document)
 
 	e_contact_set (contact, E_CONTACT_UID, (const gpointer) couchdb_document_get_id (document));
 
-	contact_name.family = desktopcouch_document_contact_get_last_name (DESKTOPCOUCH_DOCUMENT_CONTACT (document));
-	contact_name.given = desktopcouch_document_contact_get_first_name (DESKTOPCOUCH_DOCUMENT_CONTACT (document));
-	contact_name.additional = desktopcouch_document_contact_get_middle_name (DESKTOPCOUCH_DOCUMENT_CONTACT (document));
-	contact_name.prefixes = desktopcouch_document_contact_get_title (DESKTOPCOUCH_DOCUMENT_CONTACT (document));
-	contact_name.suffixes = desktopcouch_document_contact_get_suffix (DESKTOPCOUCH_DOCUMENT_CONTACT (document));
+	contact_name.family = couchdb_document_contact_get_last_name (COUCHDB_DOCUMENT_CONTACT (document));
+	contact_name.given = couchdb_document_contact_get_first_name (COUCHDB_DOCUMENT_CONTACT (document));
+	contact_name.additional = couchdb_document_contact_get_middle_name (COUCHDB_DOCUMENT_CONTACT (document));
+	contact_name.prefixes = couchdb_document_contact_get_title (COUCHDB_DOCUMENT_CONTACT (document));
+	contact_name.suffixes = couchdb_document_contact_get_suffix (COUCHDB_DOCUMENT_CONTACT (document));
 	e_contact_set (contact, E_CONTACT_NAME, (const gpointer) &contact_name);
 
 	str = e_contact_name_to_string (&contact_name);
@@ -99,38 +99,38 @@ contact_from_couch_document (CouchdbDocument *document)
 	g_free (str);
 
 	e_contact_set (contact, E_CONTACT_NICKNAME,
-		       (const gpointer) desktopcouch_document_contact_get_nick_name (DESKTOPCOUCH_DOCUMENT_CONTACT (document)));
+		       (const gpointer) couchdb_document_contact_get_nick_name (COUCHDB_DOCUMENT_CONTACT (document)));
 	e_contact_set (contact, E_CONTACT_SPOUSE,
-		       (const gpointer) desktopcouch_document_contact_get_spouse_name (DESKTOPCOUCH_DOCUMENT_CONTACT (document)));
+		       (const gpointer) couchdb_document_contact_get_spouse_name (COUCHDB_DOCUMENT_CONTACT (document)));
 
 	e_contact_set (contact, E_CONTACT_ORG,
-		       (const gpointer) desktopcouch_document_contact_get_company (DESKTOPCOUCH_DOCUMENT_CONTACT (document)));
+		       (const gpointer) couchdb_document_contact_get_company (COUCHDB_DOCUMENT_CONTACT (document)));
 	e_contact_set (contact, E_CONTACT_ORG_UNIT,
-		       (const gpointer) desktopcouch_document_contact_get_department (DESKTOPCOUCH_DOCUMENT_CONTACT (document)));
+		       (const gpointer) couchdb_document_contact_get_department (COUCHDB_DOCUMENT_CONTACT (document)));
 	e_contact_set (contact, E_CONTACT_TITLE,
-		       (const gpointer) desktopcouch_document_contact_get_job_title (DESKTOPCOUCH_DOCUMENT_CONTACT (document)));
+		       (const gpointer) couchdb_document_contact_get_job_title (COUCHDB_DOCUMENT_CONTACT (document)));
 	e_contact_set (contact, E_CONTACT_MANAGER,
-		       (const gpointer) desktopcouch_document_contact_get_manager_name (DESKTOPCOUCH_DOCUMENT_CONTACT (document)));
+		       (const gpointer) couchdb_document_contact_get_manager_name (COUCHDB_DOCUMENT_CONTACT (document)));
 	e_contact_set (contact, E_CONTACT_ASSISTANT,
-		       (const gpointer) desktopcouch_document_contact_get_assistant_name (DESKTOPCOUCH_DOCUMENT_CONTACT (document)));
+		       (const gpointer) couchdb_document_contact_get_assistant_name (COUCHDB_DOCUMENT_CONTACT (document)));
 	e_contact_set (contact, E_CONTACT_OFFICE,
-		       (const gpointer) desktopcouch_document_contact_get_office (DESKTOPCOUCH_DOCUMENT_CONTACT (document)));
+		       (const gpointer) couchdb_document_contact_get_office (COUCHDB_DOCUMENT_CONTACT (document)));
 	e_contact_set (contact, E_CONTACT_CATEGORIES,
-		       (const gpointer) desktopcouch_document_contact_get_categories (DESKTOPCOUCH_DOCUMENT_CONTACT (document)));
+		       (const gpointer) couchdb_document_contact_get_categories (COUCHDB_DOCUMENT_CONTACT (document)));
 	e_contact_set (contact, E_CONTACT_NOTE,
-		       (const gpointer) desktopcouch_document_contact_get_notes (DESKTOPCOUCH_DOCUMENT_CONTACT (document)));
+		       (const gpointer) couchdb_document_contact_get_notes (COUCHDB_DOCUMENT_CONTACT (document)));
 
 	/* parse email addresses */
 	attr_list = NULL;
 
-	list = desktopcouch_document_contact_get_email_addresses (DESKTOPCOUCH_DOCUMENT_CONTACT (document));
+	list = couchdb_document_contact_get_email_addresses (COUCHDB_DOCUMENT_CONTACT (document));
 	while (list != NULL) {
 		const char *email_str, *description_str, *uuid_str;
 		EVCardAttribute *attr;
 		CouchdbStructField *email_address = (CouchdbStructField *) list->data;
 
-		email_str = desktopcouch_document_contact_email_get_address (email_address);
-		description_str = desktopcouch_document_contact_email_get_description (email_address);
+		email_str = couchdb_document_contact_email_get_address (email_address);
+		description_str = couchdb_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));
@@ -169,14 +169,14 @@ contact_from_couch_document (CouchdbDocument *document)
 	}
 
 	/* parse phone numbers */
-	list = desktopcouch_document_contact_get_phone_numbers (DESKTOPCOUCH_DOCUMENT_CONTACT (document));
+	list = couchdb_document_contact_get_phone_numbers (COUCHDB_DOCUMENT_CONTACT (document));
 	while (list != NULL) {
 		const char *phone_str, *description_str, *uuid_str;
 		EVCardAttribute *attr;
 		CouchdbStructField *phone_number = (CouchdbStructField *) list->data;
 
-		phone_str = desktopcouch_document_contact_phone_get_number (phone_number);
-		description_str = desktopcouch_document_contact_phone_get_description (phone_number);
+		phone_str = couchdb_document_contact_phone_get_number (phone_number);
+		description_str = couchdb_document_contact_phone_get_description (phone_number);
 		uuid_str = couchdb_struct_field_get_uuid (phone_number);
 
 		if (description_str != NULL) {
@@ -281,7 +281,7 @@ contact_from_couch_document (CouchdbDocument *document)
 	}
 
 	/* parse postal addresses */
-	list = desktopcouch_document_contact_get_addresses (DESKTOPCOUCH_DOCUMENT_CONTACT (document));
+	list = couchdb_document_contact_get_addresses (COUCHDB_DOCUMENT_CONTACT (document));
 	while (list != NULL) {
 		const char *description_str;
 		EContactAddress *contact_address;
@@ -290,15 +290,15 @@ contact_from_couch_document (CouchdbDocument *document)
 		contact_address = g_new0 (EContactAddress, 1);
 		contact_address->address_format = g_strdup ("");
 
-		contact_address->street = g_strdup (desktopcouch_document_contact_address_get_street (address));
-		contact_address->ext = g_strdup (desktopcouch_document_contact_address_get_ext_street (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));
+		contact_address->street = g_strdup (couchdb_document_contact_address_get_street (address));
+		contact_address->ext = g_strdup (couchdb_document_contact_address_get_ext_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));
 		
-		description_str = desktopcouch_document_contact_address_get_description (address);
+		description_str = couchdb_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"))
@@ -314,14 +314,14 @@ contact_from_couch_document (CouchdbDocument *document)
 	}
 
 	/* parse URLs */
-	list = desktopcouch_document_contact_get_urls (DESKTOPCOUCH_DOCUMENT_CONTACT (document));
+	list = couchdb_document_contact_get_urls (COUCHDB_DOCUMENT_CONTACT (document));
 	while (list != NULL) {
 		const char *description_str, *address_str, *uuid_str;
 		EVCardAttribute *attr;
 		CouchdbStructField *url = (CouchdbStructField *) list->data;
 
-		address_str = desktopcouch_document_contact_url_get_address (url);
-		description_str = desktopcouch_document_contact_url_get_description (url);
+		address_str = couchdb_document_contact_url_get_address (url);
+		description_str = couchdb_document_contact_url_get_description (url);
 		uuid_str = couchdb_struct_field_get_uuid (url);
 
 		if (description_str != NULL) {
@@ -348,15 +348,15 @@ contact_from_couch_document (CouchdbDocument *document)
 	}
 
 	/* parse IM addresses */
-	list = desktopcouch_document_contact_get_im_addresses (DESKTOPCOUCH_DOCUMENT_CONTACT (document));
+	list = couchdb_document_contact_get_im_addresses (COUCHDB_DOCUMENT_CONTACT (document));
 	while (list != NULL) {
 		const char *address_str, *description_str, *protocol_str, *uuid_str;
 		EVCardAttribute *attr = NULL;
 		CouchdbStructField *im = (CouchdbStructField *) list->data;
 
-		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);
+		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);
 		/* Some records don't have the 'protocol' field, and use the
 		   'description' field to specify the kind of IM address this
 		   refers to */
@@ -365,21 +365,21 @@ contact_from_couch_document (CouchdbDocument *document)
 		uuid_str = couchdb_struct_field_get_uuid (im);
 
 		if (protocol_str != NULL) {
-			if (g_strcmp0 (protocol_str, DESKTOPCOUCH_DOCUMENT_CONTACT_IM_PROTOCOL_AIM) == 0)
+			if (g_strcmp0 (protocol_str, COUCHDB_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, DESKTOPCOUCH_DOCUMENT_CONTACT_IM_PROTOCOL_GADU_GADU) == 0)
+			else if (g_strcmp0 (protocol_str, COUCHDB_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, DESKTOPCOUCH_DOCUMENT_CONTACT_IM_PROTOCOL_GROUPWISE) == 0)
+			else if (g_strcmp0 (protocol_str, COUCHDB_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, DESKTOPCOUCH_DOCUMENT_CONTACT_IM_PROTOCOL_ICQ) == 0)
+			else if (g_strcmp0 (protocol_str, COUCHDB_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, DESKTOPCOUCH_DOCUMENT_CONTACT_IM_PROTOCOL_JABBER) == 0)
+			else if (g_strcmp0 (protocol_str, COUCHDB_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, DESKTOPCOUCH_DOCUMENT_CONTACT_IM_PROTOCOL_MSN) == 0)
+			else if (g_strcmp0 (protocol_str, COUCHDB_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, DESKTOPCOUCH_DOCUMENT_CONTACT_IM_PROTOCOL_SKYPE) == 0)
+			else if (g_strcmp0 (protocol_str, COUCHDB_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, DESKTOPCOUCH_DOCUMENT_CONTACT_IM_PROTOCOL_YAHOO) == 0)
+			else if (g_strcmp0 (protocol_str, COUCHDB_DOCUMENT_CONTACT_IM_PROTOCOL_YAHOO) == 0)
 				attr = e_vcard_attribute_new (NULL, e_contact_vcard_attribute (E_CONTACT_IM_YAHOO));
 
 			if (attr != NULL) {
@@ -413,7 +413,7 @@ contact_from_couch_document (CouchdbDocument *document)
 	}
 
 	/* birth date */
-	str = (char *) desktopcouch_document_contact_get_birth_date (DESKTOPCOUCH_DOCUMENT_CONTACT (document));
+	str = (char *) couchdb_document_contact_get_birth_date (COUCHDB_DOCUMENT_CONTACT (document));
 	if (str && strlen (str) > 0) {
 		EContactDate *dt;
 
@@ -425,7 +425,7 @@ contact_from_couch_document (CouchdbDocument *document)
 	}
 
 	/* wedding date */
-	str = (char *) desktopcouch_document_contact_get_wedding_date (DESKTOPCOUCH_DOCUMENT_CONTACT (document));
+	str = (char *) couchdb_document_contact_get_wedding_date (COUCHDB_DOCUMENT_CONTACT (document));
 	if (str && strlen (str)) {
 		EContactDate *dt;
 
@@ -488,7 +488,7 @@ contact_email_to_struct_field (EVCardAttribute *attr)
 
 	params = e_vcard_attribute_get_params (attr);
 	if (!params)
-		return desktopcouch_document_contact_email_new (NULL, email, NULL);
+		return couchdb_document_contact_email_new (NULL, email, NULL);
 
 	for (pl = params; pl != NULL; pl = pl->next) {
 		GList *v;
@@ -513,7 +513,7 @@ contact_email_to_struct_field (EVCardAttribute *attr)
 		}
 	}
 
-	return desktopcouch_document_contact_email_new (uuid, email, description);
+	return couchdb_document_contact_email_new (uuid, email, description);
 }
 
 static CouchdbStructField *
@@ -531,7 +531,7 @@ contact_phone_to_struct_field (EVCardAttribute *attr)
 
 	params = e_vcard_attribute_get_params (attr);
 	if (!params)
-		return desktopcouch_document_contact_phone_new (NULL, phone, NULL, /* FIXME */ 0);
+		return couchdb_document_contact_phone_new (NULL, phone, NULL, /* FIXME */ 0);
 
 	for (pl = params; pl != NULL; pl = pl->next) {
 		GList *v;
@@ -580,7 +580,7 @@ contact_phone_to_struct_field (EVCardAttribute *attr)
 	else
 		final_description = g_strdup_printf ("%s %s", description, kind);
 
-	sf = desktopcouch_document_contact_phone_new (uuid, phone, final_description, /* FIXME */ 0);
+	sf = couchdb_document_contact_phone_new (uuid, phone, final_description, /* FIXME */ 0);
 	g_free (final_description);
 
 	return sf;
@@ -594,7 +594,7 @@ contact_postal_address_to_struct_field (EContact *contact, EContactField field,
 
 	contact_address = e_contact_get (contact, field);
 	if (contact_address) {
-		sf = desktopcouch_document_contact_address_new (/* FIXME */ NULL,
+		sf = couchdb_document_contact_address_new (/* FIXME */ NULL,
 								contact_address->street,
 								contact_address->ext,
 								contact_address->locality,
@@ -622,7 +622,7 @@ contact_url_to_struct_field (EVCardAttribute *attr, const gchar *description)
 
 	params = e_vcard_attribute_get_params (attr);
 	if (!params)
-		return desktopcouch_document_contact_url_new (NULL, address, description);
+		return couchdb_document_contact_url_new (NULL, address, description);
 
 	for (pl = params; pl != NULL; pl = pl->next) {
 		GList *v;
@@ -635,7 +635,7 @@ contact_url_to_struct_field (EVCardAttribute *attr, const gchar *description)
 		}
 	}
 
-	return desktopcouch_document_contact_url_new (uuid, address, description);
+	return couchdb_document_contact_url_new (uuid, address, description);
 }
 
 static CouchdbStructField *
@@ -650,7 +650,7 @@ contact_im_to_struct_field (EVCardAttribute *attr, const gchar *protocol)
 
 	params = e_vcard_attribute_get_params (attr);
 	if (!params)
-		return desktopcouch_document_contact_im_new (NULL, address, "other", protocol);
+		return couchdb_document_contact_im_new (NULL, address, "other", protocol);
 
 	for (pl = params; pl != NULL; pl = pl->next) {
 		GList *v;
@@ -673,7 +673,7 @@ contact_im_to_struct_field (EVCardAttribute *attr, const gchar *protocol)
 		}
 	}
 
-	return desktopcouch_document_contact_im_new (uuid, address, description, protocol);
+	return couchdb_document_contact_im_new (uuid, address, description, protocol);
 }
 
 static void
@@ -708,13 +708,13 @@ couch_document_from_contact (EBookBackendCouchDB *couchdb_backend, EContact *con
 	GSList *list;
 	GList *attr_list, *al;
 	const char *str;
-	DesktopcouchDocumentContact *document;
+	CouchdbDocumentContact *document;
 	gint i;
 	CouchdbStructField *postal_address, *app_annotations;
 	EContactName *contact_name;
 
 	/* create the CouchDBDocument to put on the database */
-	document = desktopcouch_document_contact_new ();
+	document = couchdb_document_contact_new ();
 
 	str = e_contact_get_const (contact, E_CONTACT_UID);
 	if (str)
@@ -727,30 +727,30 @@ couch_document_from_contact (EBookBackendCouchDB *couchdb_backend, EContact *con
 	contact_name = (EContactName *) e_contact_get (contact, E_CONTACT_NAME);
 	if (contact_name != NULL) {
 		if (contact_name->prefixes != NULL)
-			desktopcouch_document_contact_set_title (document, (const char *) contact_name->prefixes);
+			couchdb_document_contact_set_title (document, (const char *) contact_name->prefixes);
 		if (contact_name->given != NULL)
-			desktopcouch_document_contact_set_first_name (document, (const char *) contact_name->given);
+			couchdb_document_contact_set_first_name (document, (const char *) contact_name->given);
 		if (contact_name->additional != NULL)
-			desktopcouch_document_contact_set_middle_name (document, (const gchar *) contact_name->additional);
+			couchdb_document_contact_set_middle_name (document, (const gchar *) contact_name->additional);
 		if (contact_name->family != NULL)
-			desktopcouch_document_contact_set_last_name (document, (const char *) contact_name->family);
+			couchdb_document_contact_set_last_name (document, (const char *) contact_name->family);
 		if (contact_name->suffixes != NULL)
-			desktopcouch_document_contact_set_suffix (document, (const char *) contact_name->suffixes);
+			couchdb_document_contact_set_suffix (document, (const char *) contact_name->suffixes);
 	}
 
 	e_contact_name_free (contact_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_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_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_job_title (document, (const char *) e_contact_get_const (contact, E_CONTACT_TITLE));
-	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_categories (document, (const char *) e_contact_get_const (contact, E_CONTACT_CATEGORIES));
-	desktopcouch_document_contact_set_notes (document, (const char *) e_contact_get_const (contact, E_CONTACT_NOTE));
+	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_job_title (document, (const char *) e_contact_get_const (contact, E_CONTACT_TITLE));
+	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_categories (document, (const char *) e_contact_get_const (contact, E_CONTACT_CATEGORIES));
+	couchdb_document_contact_set_notes (document, (const char *) e_contact_get_const (contact, E_CONTACT_NOTE));
 
 	/* email addresses */
 	list = NULL;
@@ -766,7 +766,7 @@ couch_document_from_contact (EBookBackendCouchDB *couchdb_backend, EContact *con
 		}
 
 		if (list) {
-			desktopcouch_document_contact_set_email_addresses (document, list);
+			couchdb_document_contact_set_email_addresses (document, list);
 
 			g_slist_foreach (list, (GFunc) g_object_unref, NULL);
 			g_slist_free (list);
@@ -791,7 +791,7 @@ couch_document_from_contact (EBookBackendCouchDB *couchdb_backend, EContact *con
 	}
 
 	if (list) {
-		desktopcouch_document_contact_set_phone_numbers (document, list);
+		couchdb_document_contact_set_phone_numbers (document, list);
 
 		g_slist_foreach (list, (GFunc) g_object_unref, NULL);
 		g_slist_free (list);
@@ -812,7 +812,7 @@ couch_document_from_contact (EBookBackendCouchDB *couchdb_backend, EContact *con
 		list = g_slist_append (list, postal_address);
 
 	if (list) {
-		desktopcouch_document_contact_set_addresses (document, list);
+		couchdb_document_contact_set_addresses (document, list);
 
 		g_slist_foreach (list, (GFunc) g_object_unref, NULL);
 		g_slist_free (list);
@@ -837,7 +837,7 @@ couch_document_from_contact (EBookBackendCouchDB *couchdb_backend, EContact *con
 	}
 
 	if (list != NULL) {
-		desktopcouch_document_contact_set_urls (document, list);
+		couchdb_document_contact_set_urls (document, list);
 
 		g_slist_foreach (list, (GFunc) g_object_unref, NULL);
 		g_slist_free (list);
@@ -852,35 +852,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, DESKTOPCOUCH_DOCUMENT_CONTACT_IM_PROTOCOL_AIM);
+			sf = contact_im_to_struct_field (attr, COUCHDB_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, DESKTOPCOUCH_DOCUMENT_CONTACT_IM_PROTOCOL_GADU_GADU);
+			sf = contact_im_to_struct_field (attr, COUCHDB_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, DESKTOPCOUCH_DOCUMENT_CONTACT_IM_PROTOCOL_GROUPWISE);
+			sf = contact_im_to_struct_field (attr, COUCHDB_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, DESKTOPCOUCH_DOCUMENT_CONTACT_IM_PROTOCOL_ICQ);
+			sf = contact_im_to_struct_field (attr, COUCHDB_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, DESKTOPCOUCH_DOCUMENT_CONTACT_IM_PROTOCOL_JABBER);
+			sf = contact_im_to_struct_field (attr, COUCHDB_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, DESKTOPCOUCH_DOCUMENT_CONTACT_IM_PROTOCOL_MSN);
+			sf = contact_im_to_struct_field (attr, COUCHDB_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, DESKTOPCOUCH_DOCUMENT_CONTACT_IM_PROTOCOL_SKYPE);
+			sf = contact_im_to_struct_field (attr, COUCHDB_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, DESKTOPCOUCH_DOCUMENT_CONTACT_IM_PROTOCOL_YAHOO);
+			sf = contact_im_to_struct_field (attr, COUCHDB_DOCUMENT_CONTACT_IM_PROTOCOL_YAHOO);
 
 		if (sf != NULL)
 			list = g_slist_append (list, sf);
 	}
 
 	if (list != NULL) {
-		desktopcouch_document_contact_set_im_addresses (document, list);
+		couchdb_document_contact_set_im_addresses (document, list);
 
 		g_slist_foreach (list, (GFunc) g_object_unref, NULL);
 		g_slist_free (list);
@@ -891,7 +891,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) {
-			desktopcouch_document_contact_set_birth_date (document, (const char *) dt_str);
+			couchdb_document_contact_set_birth_date (document, (const char *) dt_str);
 
 			g_free (dt_str);
 		}
@@ -902,7 +902,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) {
-			desktopcouch_document_contact_set_wedding_date (document, (const char *) dt_str);
+			couchdb_document_contact_set_wedding_date (document, (const char *) dt_str);
 
 			g_free (dt_str);
 		}
@@ -916,7 +916,7 @@ couch_document_from_contact (EBookBackendCouchDB *couchdb_backend, EContact *con
 		app_annotations = couchdb_struct_field_new ();
 
 	set_vcard_revision (app_annotations, contact);
-	desktopcouch_document_set_application_annotations (DESKTOPCOUCH_DOCUMENT (document), app_annotations);
+	couchdb_document_set_application_annotations (COUCHDB_DOCUMENT (document), app_annotations);
 	g_object_unref (app_annotations);
 
 	return COUCHDB_DOCUMENT (document);
@@ -1167,7 +1167,7 @@ e_book_backend_couchdb_remove_contacts (EBookBackend *backend,
 
 				/* For desktopcouch, we don't remove contacts, we just
 				 * mark them as deleted */
-				app_annotations = desktopcouch_document_get_application_annotations (DESKTOPCOUCH_DOCUMENT (document));
+				app_annotations = couchdb_document_get_application_annotations (document);
 				if (app_annotations == NULL)
 					app_annotations = couchdb_struct_field_new ();
 
@@ -1182,7 +1182,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);
-				desktopcouch_document_set_application_annotations (DESKTOPCOUCH_DOCUMENT (document), app_annotations);
+				couchdb_document_set_application_annotations (document, app_annotations);
 
 				/* Now put the new revision of the document */
 				if (couchdb_database_put_document (couchdb_backend->database, document, &error)) {



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