diff options
author | Chris Toshok <toshok@ximian.com> | 2001-10-28 11:25:28 +0800 |
---|---|---|
committer | Chris Toshok <toshok@src.gnome.org> | 2001-10-28 11:25:28 +0800 |
commit | 8638a240acd5d2179d8a650ca6fab1055aa98bfd (patch) | |
tree | e3e8dd88e94d29c8a4a93ea862084bfb8a3e00ef /addressbook | |
parent | a9491dff65271a8c6b643450938df0af74bad52c (diff) | |
download | gsoc2013-evolution-8638a240acd5d2179d8a650ca6fab1055aa98bfd.tar.gz gsoc2013-evolution-8638a240acd5d2179d8a650ca6fab1055aa98bfd.tar.zst gsoc2013-evolution-8638a240acd5d2179d8a650ca6fab1055aa98bfd.zip |
change to EBookCallback signature, and unref the book.
2001-10-27 Chris Toshok <toshok@ximian.com>
* 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
Diffstat (limited to 'addressbook')
-rw-r--r-- | addressbook/ChangeLog | 7 | ||||
-rw-r--r-- | addressbook/gui/contact-editor/e-contact-quick-add.c | 25 |
2 files changed, 27 insertions, 5 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog index 7583d0734f..38402519e6 100644 --- a/addressbook/ChangeLog +++ b/addressbook/ChangeLog @@ -1,5 +1,12 @@ 2001-10-27 Chris Toshok <toshok@ximian.com> + * 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 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 <libgnomeui/gnome-dialog.h> #include <libgnomeui/gnome-stock.h> #include <gal/widgets/e-unicode.h> +#include <addressbook/gui/component/addressbook.h> #include <addressbook/backend/ebook/e-book.h> #include <addressbook/backend/ebook/e-book-util.h> #include <addressbook/backend/ebook/e-card.h> @@ -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 |