[evolution-couchdb] Remove UID as required field, if not, creating new contacts checks fail in Evolution contact editor
- From: Rodrigo Moya <rodrigo src gnome org>
- To: svn-commits-list gnome org
- Subject: [evolution-couchdb] Remove UID as required field, if not, creating new contacts checks fail in Evolution contact editor
- Date: Tue, 23 Jun 2009 08:22:18 -0400 (EDT)
commit dcd30c1504db1ea5194a875f47106147d7ff0afc
Author: Rodrigo Moya <rodrigo gnome-db org>
Date: Tue Jun 23 14:22:09 2009 +0200
Remove UID as required field, if not, creating new contacts checks fail in Evolution contact editor
addressbook/e-book-backend-couchdb.c | 12 +++---------
1 files changed, 3 insertions(+), 9 deletions(-)
---
diff --git a/addressbook/e-book-backend-couchdb.c b/addressbook/e-book-backend-couchdb.c
index 70e1c2f..046e6e7 100644
--- a/addressbook/e-book-backend-couchdb.c
+++ b/addressbook/e-book-backend-couchdb.c
@@ -228,7 +228,6 @@ e_book_backend_couchdb_create_contact (EBookBackend *backend,
EContact *contact;
CouchDBDocument *document;
EContactDate *dt;
- char *uid;
GError *error = NULL;
EBookBackendCouchDB *couchdb_backend = E_BOOK_BACKEND_COUCHDB (backend);
static guint uid_count = 0;
@@ -239,13 +238,8 @@ e_book_backend_couchdb_create_contact (EBookBackend *backend,
return;
}
- uid = g_strdup_printf ("%08lX%08X", time (NULL), uid_count++);
- e_contact_set (contact, E_CONTACT_UID, uid);
- g_free (uid);
-
/* create the CouchDBDocument to put on the database */
document = couchdb_document_new (couchdb_backend->couchdb);
- couchdb_document_set_id (document, (const char *) e_contact_get (contact, E_CONTACT_UID));
couchdb_document_contact_set_first_name (document, (const char *) e_contact_get (contact, E_CONTACT_GIVEN_NAME));
couchdb_document_contact_set_last_name (document, (const char *) e_contact_get (contact, E_CONTACT_FAMILY_NAME));
@@ -262,7 +256,7 @@ e_book_backend_couchdb_create_contact (EBookBackend *backend,
}
/* save the contact into the DB */
- if (couchdb_document_put (document, &error))
+ if (couchdb_document_put (document, couchdb_backend->dbname, &error))
e_data_book_respond_create (book, opid, GNOME_Evolution_Addressbook_Success, contact);
else
e_data_book_respond_create (book, opid, GNOME_Evolution_Addressbook_OtherError, NULL);
@@ -435,8 +429,8 @@ e_book_backend_couchdb_get_required_fields (EBookBackend *backend,
GList *fields = NULL;
const gchar *field_name;
- field_name = e_contact_field_name (E_CONTACT_UID);
- fields = g_list_append(fields, g_strdup(field_name));
+ field_name = e_contact_field_name (E_CONTACT_GIVEN_NAME);
+ fields = g_list_append (fields, g_strdup (field_name));
e_data_book_respond_get_required_fields(book, opid,
GNOME_Evolution_Addressbook_Success, fields);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]