From 8638a240acd5d2179d8a650ca6fab1055aa98bfd Mon Sep 17 00:00:00 2001 From: Chris Toshok Date: Sun, 28 Oct 2001 03:25:28 +0000 Subject: change to EBookCallback signature, and unref the book. 2001-10-27 Chris Toshok * gui/contact-editor/e-contact-quick-add.c (merge_cb): change to EBookCallback signature, and unref the book. (quick_add_merge_card): use addressbook_load_default_book. (ce_have_book): change to EBookCallback signature, and unref the book. (edit_card): use addressbook_load_default_book. * 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=14269 --- .../gui/contact-editor/e-contact-quick-add.c | 25 +++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) (limited to 'addressbook/gui') diff --git a/addressbook/gui/contact-editor/e-contact-quick-add.c b/addressbook/gui/contact-editor/e-contact-quick-add.c index 3fb3f58ca1..f36d0b101e 100644 --- a/addressbook/gui/contact-editor/e-contact-quick-add.c +++ b/addressbook/gui/contact-editor/e-contact-quick-add.c @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include @@ -125,7 +126,7 @@ quick_add_set_email (QuickAdd *qa, const gchar *email) } static void -merge_cb (EBook *book, gpointer closure) +merge_cb (EBook *book, EBookStatus status, gpointer closure) { QuickAdd *qa = (QuickAdd *) closure; @@ -133,6 +134,7 @@ merge_cb (EBook *book, gpointer closure) e_card_merging_book_add_card (book, qa->card, NULL, NULL); if (qa->cb) qa->cb (qa->card, qa->closure); + gtk_object_unref (GTK_OBJECT (book)); } else { /* Something went wrong. */ if (qa->cb) @@ -145,8 +147,15 @@ merge_cb (EBook *book, gpointer closure) static void quick_add_merge_card (QuickAdd *qa) { + EBook *book; + quick_add_ref (qa); - e_book_use_local_address_book (merge_cb, qa); + + book = e_book_new (); + if (!addressbook_load_default_book (book, merge_cb, qa)) { + gtk_object_unref (GTK_OBJECT (book)); + merge_cb (book, E_BOOK_STATUS_OTHER_ERROR, qa); + } } @@ -182,7 +191,7 @@ editor_closed_cb (GtkWidget *w, gpointer closure) } static void -ce_have_book (EBook *book, gpointer closure) +ce_have_book (EBook *book, EBookStatus status, gpointer closure) { QuickAdd *qa = (QuickAdd *) closure; @@ -211,14 +220,20 @@ ce_have_book (EBook *book, gpointer closure) "editor_closed", GTK_SIGNAL_FUNC (editor_closed_cb), NULL); + + gtk_object_unref (GTK_OBJECT (book)); } } static void edit_card (QuickAdd *qa) { - e_book_use_local_address_book (ce_have_book, qa); - quick_add_unref (qa); + EBook *book; + book = e_book_new (); + if (!addressbook_load_default_book (book, ce_have_book, qa)) { + gtk_object_unref (GTK_OBJECT (book)); + ce_have_book (book, E_BOOK_STATUS_OTHER_ERROR, qa); + } } static void -- cgit