aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog8
-rw-r--r--addressbook/backend/pas/pas-backend-file.c28
2 files changed, 22 insertions, 14 deletions
diff --git a/ChangeLog b/ChangeLog
index 5fbde9e37e..c62a7e0d1b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
2000-04-11 Chris Toshok <toshok@helixcode.com>
+ * addressbook/backend/pas/pas-backend-file.c
+ (pas_backend_file_search): remove spew.
+ (pas_backend_file_process_create_card): move the sync to the
+ earliest possible point after the db operation.
+ (pas_backend_file_process_remove_card): same.
+ (pas_backend_file_process_modify_card): same, and call
+ pas_book_respond_modify, not pas_book_respond_remove, here.
+
* addressbook/gui/component/addressbook.c (card_deleted_cb): new
function.
(delete_contact_cb): wire up button to call
diff --git a/addressbook/backend/pas/pas-backend-file.c b/addressbook/backend/pas/pas-backend-file.c
index 632bfe285b..ed44f8929b 100644
--- a/addressbook/backend/pas/pas-backend-file.c
+++ b/addressbook/backend/pas/pas-backend-file.c
@@ -257,9 +257,7 @@ pas_backend_file_search (PASBackendFile *bf,
char *vcard_string = vcard_dbt.data;
/* check if the vcard matches the search sexp */
-
if (vcard_matches_search (view, vcard_string)) {
- printf ("card matches!\n");
cards = g_list_append (cards, strdup(vcard_string));
}
}
@@ -308,6 +306,10 @@ pas_backend_file_process_create_card (PASBackend *backend,
db_error = db->put (db, &id_dbt, &vcard_dbt, 0);
if (0 == db_error) {
+ db_error = db->sync (db, 0);
+ if (db_error != 0)
+ g_warning ("db->sync failed.\n");
+
for (list = bf->priv->book_views; list; list = g_list_next(list)) {
PASBackendFileBookView *view = list->data;
if (vcard_matches_search (view, vcard))
@@ -319,9 +321,6 @@ pas_backend_file_process_create_card (PASBackend *backend,
Evolution_BookListener_Success,
id);
- db_error = db->sync (db, 0);
- if (db_error != 0)
- g_warning ("db->sync failed.\n");
}
else {
/* XXX need a different call status for this case, i
@@ -372,6 +371,11 @@ pas_backend_file_process_remove_card (PASBackend *backend,
return;
}
+ db_error = db->sync (db, 0);
+ if (db_error != 0)
+ g_warning ("db->sync failed.\n");
+
+
vcard_string = vcard_dbt.data;
for (list = bf->priv->book_views; list; list = g_list_next(list)) {
PASBackendFileBookView *view = list->data;
@@ -383,10 +387,6 @@ pas_backend_file_process_remove_card (PASBackend *backend,
book,
Evolution_BookListener_Success);
- db_error = db->sync (db, 0);
- if (db_error != 0)
- g_warning ("db->sync failed.\n");
-
g_free (req->id);
}
@@ -413,7 +413,7 @@ pas_backend_file_process_modify_card (PASBackend *backend,
/* get the old ecard - the one that's presently in the db */
db_error = db->get (db, &id_dbt, &vcard_dbt, 0);
if (0 != db_error) {
- pas_book_respond_remove (
+ pas_book_respond_modify (
book,
Evolution_BookListener_CardNotFound);
g_free (req->id);
@@ -426,6 +426,10 @@ pas_backend_file_process_modify_card (PASBackend *backend,
db_error = db->put (db, &id_dbt, &vcard_dbt, 0);
if (0 == db_error) {
+ db_error = db->sync (db, 0);
+ if (db_error != 0)
+ g_warning ("db->sync failed.\n");
+
for (list = bf->priv->book_views; list; list = g_list_next(list)) {
PASBackendFileBookView *view = list->data;
gboolean old_match, new_match;
@@ -443,10 +447,6 @@ pas_backend_file_process_modify_card (PASBackend *backend,
pas_book_respond_modify (
book,
Evolution_BookListener_Success);
-
- db_error = db->sync (db, 0);
- if (db_error != 0)
- g_warning ("db->sync failed.\n");
}
else {
pas_book_respond_modify (