From 39c3675cc6a4e874ccfd3e95b22455c5075d8070 Mon Sep 17 00:00:00 2001 From: Chris Toshok Date: Tue, 11 Apr 2000 00:50:18 +0000 Subject: remove spew. (pas_backend_file_process_create_card): move the sync to the * 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. svn path=/trunk/; revision=2388 --- addressbook/backend/pas/pas-backend-file.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'addressbook/backend') 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 ( -- cgit v1.2.3