From dd896b147626e3f19477d1d19111fb691dbe45bd Mon Sep 17 00:00:00 2001 From: JP Rosevear Date: Mon, 27 Nov 2000 20:30:51 +0000 Subject: Remove "complete" field 2000-11-27 JP Rosevear * conduit/address-conduit.h: Remove "complete" field * conduit/address-conduit.c (print_local): Make it print useful debug info (print_remote): ditto (local_record_from_ecard): Make sure phone numbers get out to the pilot (ecard_from_remote_record): Set phone strings to "" if they are null (sequence_complete): unref the book view (view_cb): ref the book view (free_prepare): do nothing * backend/pas/pas-backend-file.c (pas_backend_file_book_view_free): Destroy the card lists with the rest of the view. (pas_backend_file_changes): Don't destroy the card lists here (pas_backend_file_book_view_free): Free the card/id lists in the change context here, the correct place. (pas_backend_file_changes): instead of here... 2000-11-27 JP Rosevear * conduits/todo/todo-conduit.c (free_prepare): Ditto * conduits/calendar/calendar-conduit.c (free_prepare): Adjust free_prepare to the correct signal parameters. Don't actually do anything - there is a semantic discrepancy that needs to be resolved. 2000-11-27 JP Rosevear * providers/local/.cvsignore: shush svn path=/trunk/; revision=6681 --- addressbook/backend/pas/pas-backend-file.c | 32 ++++++++++++++++-------------- 1 file changed, 17 insertions(+), 15 deletions(-) (limited to 'addressbook/backend') diff --git a/addressbook/backend/pas/pas-backend-file.c b/addressbook/backend/pas/pas-backend-file.c index d0ace222ad..2ff9d1164e 100644 --- a/addressbook/backend/pas/pas-backend-file.c +++ b/addressbook/backend/pas/pas-backend-file.c @@ -119,8 +119,24 @@ pas_backend_file_book_view_free(PASBackendFileBookView *book_view, void *closure if (book_view->search_sexp) gtk_object_unref(GTK_OBJECT(book_view->search_sexp)); g_free(book_view->search_context); + g_free(book_view->change_id); + if (book_view->change_context) { + g_list_foreach (book_view->change_context->add_cards, (GFunc)g_free, NULL); + g_list_foreach (book_view->change_context->add_ids, (GFunc)g_free, NULL); + g_list_foreach (book_view->change_context->mod_cards, (GFunc)g_free, NULL); + g_list_foreach (book_view->change_context->mod_ids, (GFunc)g_free, NULL); + g_list_foreach (book_view->change_context->del_cards, (GFunc)g_free, NULL); + g_list_foreach (book_view->change_context->del_ids, (GFunc)g_free, NULL); + g_list_free (book_view->change_context->add_cards); + g_list_free (book_view->change_context->add_ids); + g_list_free (book_view->change_context->mod_cards); + g_list_free (book_view->change_context->mod_ids); + g_list_free (book_view->change_context->del_cards); + g_list_free (book_view->change_context->del_ids); + } g_free(book_view->change_context); + g_free(book_view); } @@ -546,11 +562,11 @@ pas_backend_file_changes (PASBackendFile *bf, const PASBackendFileBookView *cnstview) { int db_error = 0; - DB *db = bf->priv->file_db; DBT id_dbt, vcard_dbt; char *filename; EDbHash *ehash; GList *i, *v; + DB *db = bf->priv->file_db; PASBackendFileBookView *view = (PASBackendFileBookView *)cnstview; PASBackendFileChangeContext *ctx = cnstview->change_context; @@ -628,20 +644,6 @@ pas_backend_file_changes (PASBackendFile *bf, pas_book_view_notify_complete (view->book_view); } - - /* It's fine to do this now since the data has been handed off. */ - g_list_foreach (ctx->add_cards, (GFunc)g_free, NULL); - g_list_foreach (ctx->add_ids, (GFunc)g_free, NULL); - g_list_foreach (ctx->mod_cards, (GFunc)g_free, NULL); - g_list_foreach (ctx->mod_ids, (GFunc)g_free, NULL); - g_list_foreach (ctx->del_cards, (GFunc)g_free, NULL); - g_list_foreach (ctx->del_ids, (GFunc)g_free, NULL); - g_list_free (ctx->add_cards); - g_list_free (ctx->add_ids); - g_list_free (ctx->mod_cards); - g_list_free (ctx->mod_ids); - g_list_free (ctx->del_cards); - g_list_free (ctx->del_ids); } static char * -- cgit v1.2.3