From 7950d6a0c6efd6c4d48afd99c138f38952bdd1bb Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sat, 21 Apr 2012 14:52:23 -0400 Subject: Adapt to libedataserver[ui] changes. --- addressbook/gui/contact-editor/e-contact-editor.c | 12 +++++++++--- addressbook/gui/contact-editor/e-contact-quick-add.c | 19 ++++++++++++------- 2 files changed, 21 insertions(+), 10 deletions(-) (limited to 'addressbook/gui/contact-editor') diff --git a/addressbook/gui/contact-editor/e-contact-editor.c b/addressbook/gui/contact-editor/e-contact-editor.c index 7676d62f5e..7ad3bcdb3e 100644 --- a/addressbook/gui/contact-editor/e-contact-editor.c +++ b/addressbook/gui/contact-editor/e-contact-editor.c @@ -27,6 +27,7 @@ #include "eab-editor.h" #include "e-contact-editor.h" +#include #include #include #include @@ -3094,7 +3095,9 @@ source_changed (ESourceComboBox *source_combo_box, ESource *source; GtkWindow *parent; - source = e_source_combo_box_get_active (source_combo_box); + source = e_source_combo_box_ref_active (source_combo_box); + g_return_if_fail (source != NULL); + parent = eab_editor_get_window (EAB_EDITOR (editor)); if (editor->cancellable != NULL) { @@ -3107,13 +3110,13 @@ source_changed (ESourceComboBox *source_combo_box, source_source = e_client_get_source (E_CLIENT (editor->source_client)); if (e_source_equal (target_source, source)) - return; + goto exit; if (e_source_equal (source_source, source)) { g_object_set ( editor, "target_client", editor->source_client, NULL); - return; + goto exit; } editor->cancellable = g_cancellable_new (); @@ -3123,6 +3126,9 @@ source_changed (ESourceComboBox *source_combo_box, FALSE, editor->cancellable, e_client_utils_authenticate_handler, parent, contact_editor_book_loaded_cb, g_object_ref (editor)); + +exit: + g_object_unref (source); } static void diff --git a/addressbook/gui/contact-editor/e-contact-quick-add.c b/addressbook/gui/contact-editor/e-contact-quick-add.c index 7c303e7725..69b35b6cdb 100644 --- a/addressbook/gui/contact-editor/e-contact-quick-add.c +++ b/addressbook/gui/contact-editor/e-contact-quick-add.c @@ -156,12 +156,13 @@ merge_cb (GObject *source_object, if (!e_client_is_readonly (client)) eab_merging_book_add_contact ( - E_BOOK_CLIENT (client), qa->contact, NULL, NULL); + E_BOOK_CLIENT (client), + qa->contact, NULL, NULL); else e_alert_run_dialog_for_args ( e_shell_get_active_window (NULL), "addressbook:error-read-only", - e_source_peek_name (source), + e_source_get_display_name (source), NULL); if (qa->cb) @@ -312,7 +313,8 @@ ce_have_book (GObject *source_object, g_return_if_fail (E_IS_CLIENT (client)); eab_merging_book_find_contact ( - E_BOOK_CLIENT (client), qa->contact, ce_have_contact, qa); + E_BOOK_CLIENT (client), + qa->contact, ce_have_contact, qa); } static void @@ -389,13 +391,16 @@ clicked_cb (GtkWidget *w, static void sanitize_widgets (QuickAdd *qa) { + GtkComboBox *combo_box; + const gchar *active_id; gboolean enabled = TRUE; g_return_if_fail (qa != NULL); g_return_if_fail (qa->dialog != NULL); - enabled = (e_source_combo_box_get_active_uid ( - E_SOURCE_COMBO_BOX (qa->combo_box)) != NULL); + combo_box = GTK_COMBO_BOX (qa->combo_box); + active_id = gtk_combo_box_get_active_id (combo_box); + enabled = (active_id != NULL); gtk_dialog_set_response_sensitive ( GTK_DIALOG (qa->dialog), @@ -410,12 +415,12 @@ source_changed (ESourceComboBox *source_combo_box, { ESource *source; - source = e_source_combo_box_get_active (source_combo_box); + source = e_source_combo_box_ref_active (source_combo_box); if (source != NULL) { if (qa->source != NULL) g_object_unref (qa->source); - qa->source = g_object_ref (source); + qa->source = source; /* takes reference */ } sanitize_widgets (qa); -- cgit v1.2.3