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
1=== modified file 'addressbook/e-book-backend-couchdb.c'
2--- addressbook/e-book-backend-couchdb.c 2009-10-10 09:04:04 +0000
3+++ addressbook/e-book-backend-couchdb.c 2009-10-20 11:25:17 +0000
4@@ -1083,12 +1083,25 @@
5 for (l = id_list; l != NULL; l = l->next) {
6 CouchDBDocument *document;
7 GError *error = NULL;
8- const gchar *uid = (const gchar *) id_list->data;
9+ const gchar *uid = (const gchar *) l->data;
10
11 document = couchdb_document_get (couchdb_backend->couchdb, couchdb_backend->dbname, uid, &error);
12 if (document) {
13 if (couchdb_document_delete (document, &error))
14 deleted_ids = g_list_append (deleted_ids, (gpointer) uid);
15+ else {
16+ if (error != NULL) {
17+ g_debug ("Error deleting document: %s", error->message);
18+ g_error_free (error);
19+ } else
20+ g_debug ("Error deleting document");
21+ }
22+ } else {
23+ if (error != NULL) {
24+ g_debug ("Error getting document: %s", error->message);
25+ g_error_free (error);
26+ } else
27+ g_debug ("Error getting document");
28 }
29 }
30

Subscribers

People subscribed via source and target branches