From a9491dff65271a8c6b643450938df0af74bad52c Mon Sep 17 00:00:00 2001 From: Chris Toshok Date: Sun, 28 Oct 2001 03:04:53 +0000 Subject: change to EBookCallback signature, and unref the book. (add_card_idle_cb): 2001-10-27 Chris Toshok * gui/component/e-address-popup.c (email_table_save_card_cb): change to EBookCallback signature, and unref the book. (add_card_idle_cb): use addressbook_load_default_book, and call the cb if it fails. (e_address_popup_cleanup): fix type -- should be "pop->card = NULL", not "pop = NULL". (contact_editor_cb): change to EBookCallback signature. (edit_contact_info_cb): use addressbook_load_default_book. (start_query): change to EBookCallback signature. (e_address_popup_query): use addressbook_load_default_book. * gui/widgets/e-minicard-control.c (book_open_cb): change to EBookCallback signature, and unref the book. (save_in_addressbook): use addressbook_load_default_book instead of e_book_use_local_address_book. * gui/widgets/Makefile.am (INCLUDES): change includes since we're including addressbook.h which has it's own set of funky include path requirements. svn path=/trunk/; revision=14268 --- addressbook/gui/widgets/e-minicard-control.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'addressbook/gui/widgets/e-minicard-control.c') diff --git a/addressbook/gui/widgets/e-minicard-control.c b/addressbook/gui/widgets/e-minicard-control.c index 32a8a7cdc9..73417af78c 100644 --- a/addressbook/gui/widgets/e-minicard-control.c +++ b/addressbook/gui/widgets/e-minicard-control.c @@ -19,6 +19,8 @@ #include #include +#include + #include "e-minicard-control.h" #include "e-minicard-widget.h" #include "e-card-merging.h" @@ -240,7 +242,7 @@ pstream_get_content_types (BonoboPersistStream *ps, void *closure, } static void -book_open_cb (EBook *book, gpointer closure) +book_open_cb (EBook *book, EBookStatus status, gpointer closure) { GList *list = closure; if (book) { @@ -248,6 +250,7 @@ book_open_cb (EBook *book, gpointer closure) for (p = list; p; p = p->next) { e_card_merging_book_add_card(book, p->data, NULL, NULL); } + gtk_object_unref (GTK_OBJECT (book)); } e_free_object_list (list); } @@ -257,13 +260,19 @@ save_in_addressbook(GtkWidget *button, gpointer data) { EMinicardControl *minicard_control = data; GList *list, *p; + EBook *book; + + book = e_book_new (); list = g_list_copy (minicard_control->card_list); for (p = list; p; p = p->next) gtk_object_ref (GTK_OBJECT (p->data)); - e_book_use_local_address_book (book_open_cb, list); + if (!addressbook_load_default_book (book, book_open_cb, list)) { + gtk_object_unref (GTK_OBJECT (book)); + book_open_cb (NULL, E_BOOK_STATUS_OTHER_ERROR, list); + } } static void -- cgit v1.2.3