Merge lp:~rodrigo-moya/evolution-couchdb/multiple-deletes into lp:evolution-couchdb

Proposed by Rodrigo Moya
Status: Merged
Approved by: Tim Cole
Approved revision: 82
Merge reported by: Rodrigo Moya
Merged at revision: not available
Proposed branch: lp:~rodrigo-moya/evolution-couchdb/multiple-deletes
Merge into: lp:evolution-couchdb
Diff against target: 29 lines
1 file modified
addressbook/e-book-backend-couchdb.c (+14/-1)
To merge this branch: bzr merge lp:~rodrigo-moya/evolution-couchdb/multiple-deletes
Reviewer Review Type Date Requested Status
Tim Cole (community) Approve
Mark G. Saye (community) Approve
Review via email: mp+13633@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Rodrigo Moya (rodrigo-moya) wrote :

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

Revision history for this message
Mark G. Saye (markgsaye) wrote :

Code looks fine, but not easy to test.

review: Approve
Revision history for this message
Tim Cole (tcole) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'addressbook/e-book-backend-couchdb.c'
--- addressbook/e-book-backend-couchdb.c 2009-10-10 09:04:04 +0000
+++ addressbook/e-book-backend-couchdb.c 2009-10-20 11:25:17 +0000
@@ -1083,12 +1083,25 @@
1083 for (l = id_list; l != NULL; l = l->next) {1083 for (l = id_list; l != NULL; l = l->next) {
1084 CouchDBDocument *document;1084 CouchDBDocument *document;
1085 GError *error = NULL;1085 GError *error = NULL;
1086 const gchar *uid = (const gchar *) id_list->data;1086 const gchar *uid = (const gchar *) l->data;
10871087
1088 document = couchdb_document_get (couchdb_backend->couchdb, couchdb_backend->dbname, uid, &error);1088 document = couchdb_document_get (couchdb_backend->couchdb, couchdb_backend->dbname, uid, &error);
1089 if (document) {1089 if (document) {
1090 if (couchdb_document_delete (document, &error))1090 if (couchdb_document_delete (document, &error))
1091 deleted_ids = g_list_append (deleted_ids, (gpointer) uid);1091 deleted_ids = g_list_append (deleted_ids, (gpointer) uid);
1092 else {
1093 if (error != NULL) {
1094 g_debug ("Error deleting document: %s", error->message);
1095 g_error_free (error);
1096 } else
1097 g_debug ("Error deleting document");
1098 }
1099 } else {
1100 if (error != NULL) {
1101 g_debug ("Error getting document: %s", error->message);
1102 g_error_free (error);
1103 } else
1104 g_debug ("Error getting document");
1092 }1105 }
1093 }1106 }
10941107

Subscribers

People subscribed via source and target branches