aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui/contact-editor
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2012-04-22 02:52:23 +0800
committerMatthew Barnes <mbarnes@redhat.com>2012-04-22 05:07:15 +0800
commit7950d6a0c6efd6c4d48afd99c138f38952bdd1bb (patch)
tree3a8fd7957dd29441120d2db18ccb1cc23f5935f2 /addressbook/gui/contact-editor
parent397b15ff4aa5afd1d5c7e0a093a33616624401cf (diff)
downloadgsoc2013-evolution-7950d6a0c6efd6c4d48afd99c138f38952bdd1bb.tar
gsoc2013-evolution-7950d6a0c6efd6c4d48afd99c138f38952bdd1bb.tar.gz
gsoc2013-evolution-7950d6a0c6efd6c4d48afd99c138f38952bdd1bb.tar.bz2
gsoc2013-evolution-7950d6a0c6efd6c4d48afd99c138f38952bdd1bb.tar.lz
gsoc2013-evolution-7950d6a0c6efd6c4d48afd99c138f38952bdd1bb.tar.xz
gsoc2013-evolution-7950d6a0c6efd6c4d48afd99c138f38952bdd1bb.tar.zst
gsoc2013-evolution-7950d6a0c6efd6c4d48afd99c138f38952bdd1bb.zip
Adapt to libedataserver[ui] changes.
Diffstat (limited to 'addressbook/gui/contact-editor')
-rw-r--r--addressbook/gui/contact-editor/e-contact-editor.c12
-rw-r--r--addressbook/gui/contact-editor/e-contact-quick-add.c19
2 files changed, 21 insertions, 10 deletions
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 <stdlib.h>
#include <string.h>
#include <time.h>
#include <gtk/gtk.h>
@@ -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);