aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJP Rosevear <jpr@ximian.com>2001-10-02 02:27:46 +0800
committerJP Rosevear <jpr@src.gnome.org>2001-10-02 02:27:46 +0800
commitbd549a75ae299604659b06e6c2049b2b81680b31 (patch)
tree358096dca478e3d3ae65f6af29fd33dccc9c542b
parent68a1ba71154f3e443a2efa309a70409df1927f13 (diff)
downloadgsoc2013-evolution-bd549a75ae299604659b06e6c2049b2b81680b31.tar
gsoc2013-evolution-bd549a75ae299604659b06e6c2049b2b81680b31.tar.gz
gsoc2013-evolution-bd549a75ae299604659b06e6c2049b2b81680b31.tar.bz2
gsoc2013-evolution-bd549a75ae299604659b06e6c2049b2b81680b31.tar.lz
gsoc2013-evolution-bd549a75ae299604659b06e6c2049b2b81680b31.tar.xz
gsoc2013-evolution-bd549a75ae299604659b06e6c2049b2b81680b31.tar.zst
gsoc2013-evolution-bd549a75ae299604659b06e6c2049b2b81680b31.zip
if there is a db error, assume deletion (pas_backend_file_changes): write
001-10-01 JP Rosevear <jpr@ximian.com> * backend/pas/pas-backend-file.c (pas_backend_file_changes_foreach_key): if there is a db error, assume deletion (pas_backend_file_changes): write after all is done for efficiency svn path=/trunk/; revision=13267
-rw-r--r--addressbook/ChangeLog7
-rw-r--r--addressbook/backend/pas/pas-backend-file.c9
2 files changed, 9 insertions, 7 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog
index 04730b135e..4ad8a2d67e 100644
--- a/addressbook/ChangeLog
+++ b/addressbook/ChangeLog
@@ -1,3 +1,10 @@
+2001-10-01 JP Rosevear <jpr@ximian.com>
+
+ * backend/pas/pas-backend-file.c
+ (pas_backend_file_changes_foreach_key): if there is a db error,
+ assume deletion
+ (pas_backend_file_changes): write after all is done for efficiency
+
2001-09-28 JP Rosevear <jpr@ximian.com>
* backend/pas/pas-backend-file.c
diff --git a/addressbook/backend/pas/pas-backend-file.c b/addressbook/backend/pas/pas-backend-file.c
index b8ef4931fb..56c6485e7f 100644
--- a/addressbook/backend/pas/pas-backend-file.c
+++ b/addressbook/backend/pas/pas-backend-file.c
@@ -346,7 +346,7 @@ pas_backend_file_changes_foreach_key (const char *key, gpointer user_data)
memset (&vcard_dbt, 0, sizeof (vcard_dbt));
db_error = db->get (db, NULL, &id_dbt, &vcard_dbt, 0);
- if (db_error == DB_NOTFOUND) {
+ if (db_error != 0) {
char *id = id_dbt.data;
ctx->del_ids = g_list_append (ctx->del_ids, g_strdup (id));
@@ -452,8 +452,6 @@ pas_backend_file_changes (PASBackendFile *bf,
char *vcard = v->data;
e_dbhash_add (ehash, id, vcard);
- e_dbhash_write (ehash);
-
g_free (i->data);
g_free (v->data);
}
@@ -462,8 +460,6 @@ pas_backend_file_changes (PASBackendFile *bf,
char *vcard = v->data;
e_dbhash_add (ehash, id, vcard);
- e_dbhash_write (ehash);
-
g_free (i->data);
g_free (v->data);
}
@@ -471,11 +467,10 @@ pas_backend_file_changes (PASBackendFile *bf,
char *id = i->data;
e_dbhash_remove (ehash, id);
- e_dbhash_write (ehash);
-
g_free (i->data);
}
+ e_dbhash_write (ehash);
e_dbhash_destroy (ehash);
}