[evolution-couchdb] Get the UID from the iterated list item, not from the head of the list, which tries to delete all th



commit 3420a1b23316371922bca9287beb454b09be542f
Author: Rodrigo Moya <rodrigo gnome-db org>
Date:   Tue Oct 20 17:44:08 2009 +0200

    Get the UID from the iterated list item, not from the head of the list, which tries to delete all the time the first ID

 addressbook/e-book-backend-couchdb.c |   15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)
---
diff --git a/addressbook/e-book-backend-couchdb.c b/addressbook/e-book-backend-couchdb.c
index c8364b1..834df63 100644
--- a/addressbook/e-book-backend-couchdb.c
+++ b/addressbook/e-book-backend-couchdb.c
@@ -1083,12 +1083,25 @@ e_book_backend_couchdb_remove_contacts (EBookBackend *backend,
 	for (l = id_list; l != NULL; l = l->next) {
 		CouchDBDocument *document;
 		GError *error = NULL;
-		const gchar *uid = (const gchar *) id_list->data;
+		const gchar *uid = (const gchar *) l->data;
 
 		document = couchdb_document_get (couchdb_backend->couchdb, couchdb_backend->dbname, uid, &error);
 		if (document) {
 			if (couchdb_document_delete (document, &error))
 				deleted_ids = g_list_append (deleted_ids, (gpointer) uid);
+			else {
+				if (error != NULL) {
+					g_debug ("Error deleting document: %s", error->message);
+					g_error_free (error);
+				} else
+					g_debug ("Error deleting document");
+			}
+		} else {
+			if (error != NULL) {
+				g_debug ("Error getting document: %s", error->message);
+				g_error_free (error);
+			} else
+				g_debug ("Error getting document");
 		}
 	}
 



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