aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/backend/pas
diff options
context:
space:
mode:
authorChris Toshok <toshok@src.gnome.org>2000-04-11 08:50:18 +0800
committerChris Toshok <toshok@src.gnome.org>2000-04-11 08:50:18 +0800
commit39c3675cc6a4e874ccfd3e95b22455c5075d8070 (patch)
treeb0ad03a547aeefeafcca8878560b610027f2ad5d /addressbook/backend/pas
parentce05b0db24215b2a29c89d502570ab1dcd63d24a (diff)
downloadgsoc2013-evolution-39c3675cc6a4e874ccfd3e95b22455c5075d8070.tar
gsoc2013-evolution-39c3675cc6a4e874ccfd3e95b22455c5075d8070.tar.gz
gsoc2013-evolution-39c3675cc6a4e874ccfd3e95b22455c5075d8070.tar.bz2
gsoc2013-evolution-39c3675cc6a4e874ccfd3e95b22455c5075d8070.tar.lz
gsoc2013-evolution-39c3675cc6a4e874ccfd3e95b22455c5075d8070.tar.xz
gsoc2013-evolution-39c3675cc6a4e874ccfd3e95b22455c5075d8070.tar.zst
gsoc2013-evolution-39c3675cc6a4e874ccfd3e95b22455c5075d8070.zip
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
Diffstat (limited to 'addressbook/backend/pas')
-rw-r--r--addressbook/backend/pas/pas-backend-file.c28
1 files changed, 14 insertions, 14 deletions
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 (