diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2012-04-22 02:52:23 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2012-04-22 05:07:15 +0800 |
commit | 7950d6a0c6efd6c4d48afd99c138f38952bdd1bb (patch) | |
tree | 3a8fd7957dd29441120d2db18ccb1cc23f5935f2 /modules/addressbook | |
parent | 397b15ff4aa5afd1d5c7e0a093a33616624401cf (diff) | |
download | gsoc2013-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 'modules/addressbook')
-rw-r--r-- | modules/addressbook/addressbook-config.c | 12 | ||||
-rw-r--r-- | modules/addressbook/e-book-shell-sidebar.c | 9 | ||||
-rw-r--r-- | modules/addressbook/e-book-shell-view-actions.c | 17 | ||||
-rw-r--r-- | modules/addressbook/e-book-shell-view-private.c | 9 |
4 files changed, 31 insertions, 16 deletions
diff --git a/modules/addressbook/addressbook-config.c b/modules/addressbook/addressbook-config.c index beccf33856..7e09c1b5da 100644 --- a/modules/addressbook/addressbook-config.c +++ b/modules/addressbook/addressbook-config.c @@ -482,7 +482,7 @@ eabc_type_changed (GtkComboBox *dropdown, } e_source_set_property(sdialog->source, "auth-domain", "Groupwise"); - tmp = g_strconcat (";", e_source_peek_name(sdialog->source), NULL); + tmp = g_strconcat (";", e_source_get_display_name(sdialog->source), NULL); e_source_set_relative_uri (sdialog->source, tmp); g_free (tmp); #ifdef HAVE_LDAP @@ -499,7 +499,7 @@ eabc_type_changed (GtkComboBox *dropdown, e_source_set_property(sdialog->source, "limit", "100"); #endif } else { - e_source_set_relative_uri (sdialog->source, e_source_peek_uid (sdialog->source)); + e_source_set_relative_uri (sdialog->source, e_source_get_uid (sdialog->source)); } e_config_target_changed ((EConfig *) sdialog->config, E_CONFIG_TARGET_CHANGED_REBUILD); @@ -573,7 +573,7 @@ name_changed_cb (GtkWidget *w, text = gtk_entry_get_text (GTK_ENTRY (sdialog->display_name)); stripped_name = g_strstrip (g_strdup (text)); - changed = g_strcmp0 (stripped_name, e_source_peek_name (sdialog->source)) != 0; + changed = g_strcmp0 (stripped_name, e_source_get_display_name (sdialog->source)) != 0; e_source_set_name (sdialog->source, stripped_name); g_free (stripped_name); @@ -607,7 +607,7 @@ eabc_general_name (EConfig *ec, g_signal_connect ( sdialog->display_name, "changed", G_CALLBACK (name_changed_cb), sdialog); - gtk_entry_set_text ((GtkEntry *) sdialog->display_name, e_source_peek_name (sdialog->source)); + gtk_entry_set_text ((GtkEntry *) sdialog->display_name, e_source_get_display_name (sdialog->source)); /* Hardcoded: groupwise can't edit the name (or anything else) */ if (sdialog->original_source) { @@ -1204,7 +1204,7 @@ eabc_check_complete (EConfig *ec, d(printf("check complete, pageid = '%s'\n", pageid?pageid:"<all>")); /* have name, and unique */ - tmp = e_source_peek_name (sdialog->source); + tmp = e_source_get_display_name (sdialog->source); valid = tmp && tmp[0] != 0 && ((source = e_source_group_peek_source_by_name (sdialog->source_group, tmp)) == NULL || source == sdialog->original_source); @@ -1349,7 +1349,7 @@ addressbook_config_edit_source (GtkWidget *parent, /* forces initial validation */ if (!sdialog->original_source) { - e_source_set_relative_uri (sdialog->source, e_source_peek_uid (sdialog->source)); + e_source_set_relative_uri (sdialog->source, e_source_get_uid (sdialog->source)); e_config_target_changed ((EConfig *) ec, E_CONFIG_TARGET_CHANGED_STATE); } diff --git a/modules/addressbook/e-book-shell-sidebar.c b/modules/addressbook/e-book-shell-sidebar.c index af28f8bbb1..d47dbd75f9 100644 --- a/modules/addressbook/e-book-shell-sidebar.c +++ b/modules/addressbook/e-book-shell-sidebar.c @@ -151,25 +151,30 @@ book_shell_sidebar_check_state (EShellSidebar *shell_sidebar) ESource *source; gboolean can_delete = FALSE; gboolean is_system = FALSE; + gboolean has_primary_source = FALSE; guint32 state = 0; book_shell_sidebar = E_BOOK_SHELL_SIDEBAR (shell_sidebar); selector = e_book_shell_sidebar_get_selector (book_shell_sidebar); - source = e_source_selector_get_primary_selection (selector); + source = e_source_selector_ref_primary_selection (selector); if (source != NULL) { const gchar *uri; const gchar *delete; + has_primary_source = TRUE; + uri = e_source_peek_relative_uri (source); is_system = (uri == NULL || strcmp (uri, "system") == 0); can_delete = !is_system; delete = e_source_get_property (source, "delete"); can_delete &= (delete == NULL || strcmp (delete, "no") != 0); + + g_object_unref (source); } - if (source != NULL) + if (has_primary_source) state |= E_BOOK_SHELL_SIDEBAR_HAS_PRIMARY_SOURCE; if (can_delete) state |= E_BOOK_SHELL_SIDEBAR_CAN_DELETE_PRIMARY_SOURCE; diff --git a/modules/addressbook/e-book-shell-view-actions.c b/modules/addressbook/e-book-shell-view-actions.c index 33c382bc4f..50834113c9 100644 --- a/modules/addressbook/e-book-shell-view-actions.c +++ b/modules/addressbook/e-book-shell-view-actions.c @@ -73,20 +73,23 @@ action_address_book_delete_cb (GtkAction *action, book_shell_sidebar = book_shell_view->priv->book_shell_sidebar; selector = e_book_shell_sidebar_get_selector (book_shell_sidebar); - source = e_source_selector_get_primary_selection (selector); + source = e_source_selector_ref_primary_selection (selector); g_return_if_fail (source != NULL); response = e_alert_run_dialog_for_args ( GTK_WINDOW (shell_window), "addressbook:ask-delete-addressbook", - e_source_peek_name (source), NULL); + e_source_get_display_name (source), NULL); - if (response != GTK_RESPONSE_YES) + if (response != GTK_RESPONSE_YES) { + g_object_unref (source); return; + } book = e_book_client_new (source, &error); if (error != NULL) { g_warning ("Error removing addressbook: %s", error->message); + g_object_unref (source); g_error_free (error); return; } @@ -95,6 +98,7 @@ action_address_book_delete_cb (GtkAction *action, e_alert_run_dialog_for_args ( GTK_WINDOW (shell_window), "addressbook:remove-addressbook", NULL); + g_object_unref (source); g_object_unref (book); return; } @@ -107,6 +111,7 @@ action_address_book_delete_cb (GtkAction *action, e_source_list_sync (source_list, NULL); + g_object_unref (source); g_object_unref (book); } @@ -187,10 +192,10 @@ action_address_book_properties_cb (GtkAction *action, book_shell_sidebar = book_shell_view->priv->book_shell_sidebar; selector = e_book_shell_sidebar_get_selector (book_shell_sidebar); - source = e_source_selector_get_primary_selection (selector); + source = e_source_selector_ref_primary_selection (selector); g_return_if_fail (source != NULL); - uid = e_source_peek_uid (source); + uid = e_source_get_uid (source); uid_to_editor = book_shell_view->priv->uid_to_editor; closure = g_hash_table_lookup (uid_to_editor, uid); @@ -213,6 +218,8 @@ action_address_book_properties_cb (GtkAction *action, } gtk_window_present (GTK_WINDOW (closure->editor)); + + g_object_unref (source); } #ifdef WITH_CONTACT_MAPS diff --git a/modules/addressbook/e-book-shell-view-private.c b/modules/addressbook/e-book-shell-view-private.c index 3c3b1a9a8f..62793f3e50 100644 --- a/modules/addressbook/e-book-shell-view-private.c +++ b/modules/addressbook/e-book-shell-view-private.c @@ -271,12 +271,12 @@ book_shell_view_activate_selected_source (EBookShellView *book_shell_view, shell_window = e_shell_view_get_shell_window (shell_view); book_shell_content = book_shell_view->priv->book_shell_content; - source = e_source_selector_get_primary_selection (selector); + source = e_source_selector_ref_primary_selection (selector); if (source == NULL) return; - uid = e_source_peek_uid (source); + uid = e_source_get_uid (source); hash_table = book_shell_view->priv->uid_to_view; widget = g_hash_table_lookup (hash_table, uid); @@ -339,7 +339,8 @@ book_shell_view_activate_selected_source (EBookShellView *book_shell_view, model = e_addressbook_view_get_model (view); /* XXX No way to cancel this? */ - e_client_utils_open_new (source, E_CLIENT_SOURCE_TYPE_CONTACTS, FALSE, NULL, + e_client_utils_open_new ( + source, E_CLIENT_SOURCE_TYPE_CONTACTS, FALSE, NULL, e_client_utils_authenticate_handler, GTK_WINDOW (shell_window), book_shell_view_loaded_cb, g_object_ref (view)); @@ -380,6 +381,8 @@ book_shell_view_activate_selected_source (EBookShellView *book_shell_view, e_addressbook_model_force_folder_bar_message (model); selection_change (book_shell_view, view); + + g_object_unref (source); } static gboolean |