From e2b6ff7a6c1e1580c26ee0719b349151e8dad6fd Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Tue, 27 Sep 2011 01:13:42 -0400 Subject: Miscellaneous cleanups from the account-mgmt branch. Reducing diff noise so I can see important changes easier when comparing branches. A few API changes, but nothing that affects functionality. --- addressbook/gui/widgets/e-addressbook-model.c | 9 +++++--- addressbook/gui/widgets/e-addressbook-model.h | 6 ++++-- addressbook/gui/widgets/e-addressbook-selector.c | 6 ++++-- .../gui/widgets/e-addressbook-table-adapter.c | 7 +++++-- addressbook/gui/widgets/e-addressbook-view.c | 9 ++++---- addressbook/gui/widgets/ea-minicard-view.c | 19 ++++++++++------- addressbook/gui/widgets/eab-gui-util.c | 24 ++++++++++++++-------- 7 files changed, 52 insertions(+), 28 deletions(-) (limited to 'addressbook/gui/widgets') diff --git a/addressbook/gui/widgets/e-addressbook-model.c b/addressbook/gui/widgets/e-addressbook-model.c index 74e794bd6e..fa61c4e5e2 100644 --- a/addressbook/gui/widgets/e-addressbook-model.c +++ b/addressbook/gui/widgets/e-addressbook-model.c @@ -576,7 +576,8 @@ addressbook_model_class_init (EAddressbookModelClass *class) "EBookClient", NULL, E_TYPE_BOOK_CLIENT, - G_PARAM_READWRITE)); + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS)); g_object_class_install_property ( object_class, @@ -586,7 +587,8 @@ addressbook_model_class_init (EAddressbookModelClass *class) "Editable", NULL, FALSE, - G_PARAM_READWRITE)); + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS)); g_object_class_install_property ( object_class, @@ -597,7 +599,8 @@ addressbook_model_class_init (EAddressbookModelClass *class) NULL, NULL, G_PARAM_READWRITE | - G_PARAM_CONSTRUCT)); + G_PARAM_CONSTRUCT | + G_PARAM_STATIC_STRINGS)); signals[WRITABLE_STATUS] = g_signal_new ("writable_status", diff --git a/addressbook/gui/widgets/e-addressbook-model.h b/addressbook/gui/widgets/e-addressbook-model.h index 13d23e92b0..680352c717 100644 --- a/addressbook/gui/widgets/e-addressbook-model.h +++ b/addressbook/gui/widgets/e-addressbook-model.h @@ -104,8 +104,10 @@ gint e_addressbook_model_find (EAddressbookModel *model, EBookClient * e_addressbook_model_get_client (EAddressbookModel *model); void e_addressbook_model_set_client (EAddressbookModel *model, EBookClient *book_client); -gboolean e_addressbook_model_get_editable (EAddressbookModel *model); -void e_addressbook_model_set_editable (EAddressbookModel *model, +gboolean e_addressbook_model_get_editable + (EAddressbookModel *model); +void e_addressbook_model_set_editable + (EAddressbookModel *model, gboolean editable); gchar * e_addressbook_model_get_query (EAddressbookModel *model); void e_addressbook_model_set_query (EAddressbookModel *model, diff --git a/addressbook/gui/widgets/e-addressbook-selector.c b/addressbook/gui/widgets/e-addressbook-selector.c index b6bfa01537..30bb8899f5 100644 --- a/addressbook/gui/widgets/e-addressbook-selector.c +++ b/addressbook/gui/widgets/e-addressbook-selector.c @@ -293,7 +293,8 @@ target_client_open_ready_cb (GObject *source_object, } eab_merging_book_add_contact ( - merge_context->target_client, merge_context->current_contact, + merge_context->target_client, + merge_context->current_contact, addressbook_selector_merge_next_cb, merge_context); } @@ -335,7 +336,8 @@ addressbook_selector_data_dropped (ESourceSelector *selector, merge_context->remove_from_source = remove_from_source; merge_context->pending_adds = TRUE; - e_client_utils_open_new (destination, E_CLIENT_SOURCE_TYPE_CONTACTS, FALSE, NULL, + e_client_utils_open_new ( + destination, E_CLIENT_SOURCE_TYPE_CONTACTS, FALSE, NULL, e_client_utils_authenticate_handler, NULL, target_client_open_ready_cb, merge_context); diff --git a/addressbook/gui/widgets/e-addressbook-table-adapter.c b/addressbook/gui/widgets/e-addressbook-table-adapter.c index f102b684d7..463bdc7a3d 100644 --- a/addressbook/gui/widgets/e-addressbook-table-adapter.c +++ b/addressbook/gui/widgets/e-addressbook-table-adapter.c @@ -168,8 +168,11 @@ addressbook_set_value_at (ETableModel *etc, EAddressbookTableAdapterPrivate *priv = adapter->priv; if (e_addressbook_model_get_editable (priv->model)) { + EBookClient *book_client; EContact *contact; + book_client = e_addressbook_model_get_client (priv->model); + if (col >= COLS || row >= e_addressbook_model_contact_count (priv->model)) return; @@ -191,7 +194,7 @@ addressbook_set_value_at (ETableModel *etc, e_contact_set (contact, col, (gpointer) val); eab_merging_book_modify_contact ( - e_addressbook_model_get_client (priv->model), + book_client, contact, contact_modified_cb, etc); g_object_unref (contact); @@ -218,8 +221,8 @@ addressbook_append_row (ETableModel *etm, { EAddressbookTableAdapter *adapter = EAB_TABLE_ADAPTER (etm); EAddressbookTableAdapterPrivate *priv = adapter->priv; - EContact *contact; EBookClient *book_client; + EContact *contact; gint col; contact = e_contact_new (); diff --git a/addressbook/gui/widgets/e-addressbook-view.c b/addressbook/gui/widgets/e-addressbook-view.c index 7f3a7a85b8..9bda90a280 100644 --- a/addressbook/gui/widgets/e-addressbook-view.c +++ b/addressbook/gui/widgets/e-addressbook-view.c @@ -1111,7 +1111,7 @@ folder_bar_message (EAddressbookView *view, { EShellView *shell_view; EShellSidebar *shell_sidebar; - const gchar *name; + const gchar *display_name; shell_view = e_addressbook_view_get_shell_view (view); shell_sidebar = e_shell_view_get_shell_sidebar (shell_view); @@ -1119,8 +1119,8 @@ folder_bar_message (EAddressbookView *view, if (view->priv->source == NULL) return; - name = e_source_peek_name (view->priv->source); - e_shell_sidebar_set_primary_text (shell_sidebar, name); + display_name = e_source_peek_name (view->priv->source); + e_shell_sidebar_set_primary_text (shell_sidebar, display_name); e_shell_sidebar_set_secondary_text (shell_sidebar, message); } @@ -1622,7 +1622,8 @@ view_transfer_contacts (EAddressbookView *view, contacts = e_addressbook_view_get_selected (view); eab_transfer_contacts ( - book_client, contacts, delete_from_source, alert_sink); + book_client, contacts, + delete_from_source, alert_sink); } } diff --git a/addressbook/gui/widgets/ea-minicard-view.c b/addressbook/gui/widgets/ea-minicard-view.c index 58d3a5fd2b..6772a0bf80 100644 --- a/addressbook/gui/widgets/ea-minicard-view.c +++ b/addressbook/gui/widgets/ea-minicard-view.c @@ -149,7 +149,8 @@ ea_minicard_view_get_name (AtkObject *accessible) gchar *string; EMinicardView *card_view; EBookClient *book_client = NULL; - const gchar *source_name; + ESource *source; + const gchar *display_name; g_return_val_if_fail (EA_IS_MINICARD_VIEW (accessible), NULL); @@ -163,13 +164,14 @@ ea_minicard_view_get_name (AtkObject *accessible) card_view = E_MINICARD_VIEW (reflow); g_object_get (card_view->adapter, "client", &book_client, NULL); g_return_val_if_fail (E_IS_BOOK_CLIENT (book_client), NULL); - source_name = e_source_peek_name (e_client_get_source (E_CLIENT (book_client))); - if (!source_name) - source_name=""; + source = e_client_get_source (E_CLIENT (book_client)); + display_name = e_source_peek_name (source); + if (display_name == NULL) + display_name = ""; string = g_strdup_printf (ngettext ("current address book folder %s has %d card", "current address book folder %s has %d cards", - reflow->count), source_name, reflow->count); + reflow->count), display_name, reflow->count); ATK_OBJECT_CLASS (parent_class)->set_name (accessible, string); g_free (string); @@ -372,7 +374,9 @@ static void atk_action_interface_init (AtkActionIface *iface) iface->get_name = atk_action_interface_get_name; } -static gboolean atk_action_interface_do_action (AtkAction *action, gint i) +static gboolean +atk_action_interface_do_action (AtkAction *action, + gint i) { gboolean return_value = TRUE; EMinicardView *card_view; @@ -405,7 +409,8 @@ static gboolean atk_action_interface_do_action (AtkAction *action, gint i) return return_value; } -static gint atk_action_interface_get_n_action (AtkAction *iface) +static gint +atk_action_interface_get_n_action (AtkAction *iface) { return G_N_ELEMENTS (action_name); } diff --git a/addressbook/gui/widgets/eab-gui-util.c b/addressbook/gui/widgets/eab-gui-util.c index c951b290c7..00f4e884c7 100644 --- a/addressbook/gui/widgets/eab-gui-util.c +++ b/addressbook/gui/widgets/eab-gui-util.c @@ -34,13 +34,13 @@ #include #include +#include #include #include #include #include #include "eab-gui-util.h" #include "util/eab-book-util.h" -#include #include "e-util/e-alert-dialog.h" #include "e-util/e-html-utils.h" #include "shell/e-shell.h" @@ -319,14 +319,18 @@ eab_select_source (ESource *except_source, selector = e_source_selector_new (source_list); e_source_selector_show_selection (E_SOURCE_SELECTOR (selector), FALSE); if (except_source) - g_object_set_data (G_OBJECT (ok_button), "except-source", e_source_list_peek_source_by_uid (source_list, e_source_peek_uid (except_source))); - g_signal_connect (selector, "primary_selection_changed", - G_CALLBACK (source_selection_changed_cb), ok_button); + g_object_set_data ( + G_OBJECT (ok_button), "except-source", + e_source_list_peek_source_by_uid (source_list, e_source_peek_uid (except_source))); + g_signal_connect ( + selector, "primary_selection_changed", + G_CALLBACK (source_selection_changed_cb), ok_button); if (select_uid) { source = e_source_list_peek_source_by_uid (source_list, select_uid); if (source) - e_source_selector_set_primary_selection (E_SOURCE_SELECTOR (selector), source); + e_source_selector_set_primary_selection ( + E_SOURCE_SELECTOR (selector), source); } scrolled_window = gtk_scrolled_window_new (NULL, NULL); @@ -493,7 +497,9 @@ do_copy (gpointer data, book_client = process->destination; process->count++; - eab_merging_book_add_contact (book_client, contact, contact_added_cb, process); + eab_merging_book_add_contact ( + book_client, + contact, contact_added_cb, process); } static void @@ -533,6 +539,7 @@ eab_transfer_contacts (EBookClient *source_client, gboolean delete_from_source, EAlertSink *alert_sink) { + ESource *source; ESource *destination; static gchar *last_uid = NULL; ContactCopyProcess *process; @@ -559,9 +566,10 @@ eab_transfer_contacts (EBookClient *source_client, desc = _("Copy contacts to"); } + source = e_client_get_source (E_CLIENT (source_client)); + destination = eab_select_source ( - e_client_get_source (E_CLIENT (source_client)), - desc, NULL, last_uid, window); + source, desc, NULL, last_uid, window); if (!destination) return; -- cgit v1.2.3