diff options
author | JP Rosevear <jpr@ximian.com> | 2001-10-02 02:27:46 +0800 |
---|---|---|
committer | JP Rosevear <jpr@src.gnome.org> | 2001-10-02 02:27:46 +0800 |
commit | bd549a75ae299604659b06e6c2049b2b81680b31 (patch) | |
tree | 358096dca478e3d3ae65f6af29fd33dccc9c542b /addressbook/backend | |
parent | 68a1ba71154f3e443a2efa309a70409df1927f13 (diff) | |
download | gsoc2013-evolution-bd549a75ae299604659b06e6c2049b2b81680b31.tar.gz 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
Diffstat (limited to 'addressbook/backend')
-rw-r--r-- | addressbook/backend/pas/pas-backend-file.c | 9 |
1 files changed, 2 insertions, 7 deletions
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); } |