From a01525c9316b13153cb00fa99cdc587e3ce7c350 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Wed, 7 Dec 2011 15:25:02 -0500 Subject: Miscellaneous EShellView-related cleanups. --- shell/e-shell-switcher.c | 10 ++++++---- shell/e-shell-window-actions.c | 7 +++++-- shell/e-shell-window-private.c | 37 ++++++++++++++++++++++++------------- shell/test/e-test-shell-backend.c | 8 -------- shell/test/e-test-shell-view.c | 13 ++++++++----- 5 files changed, 43 insertions(+), 32 deletions(-) (limited to 'shell') diff --git a/shell/e-shell-switcher.c b/shell/e-shell-switcher.c index 3a72851f97..1deefa5613 100644 --- a/shell/e-shell-switcher.c +++ b/shell/e-shell-switcher.c @@ -647,10 +647,12 @@ e_shell_switcher_add_action (EShellSwitcher *switcher, gtk_tool_item_set_is_important (GTK_TOOL_ITEM (widget), TRUE); gtk_widget_show (widget); - if ((button = tool_item_get_button (widget)) != NULL) - g_signal_connect (button, "button-release-event", - G_CALLBACK (tool_item_button_cb), - new_window_action); + button = tool_item_get_button (widget); + if (button != NULL) + g_signal_connect ( + button, "button-release-event", + G_CALLBACK (tool_item_button_cb), + new_window_action); switcher->priv->proxies = g_list_append ( switcher->priv->proxies, widget); diff --git a/shell/e-shell-window-actions.c b/shell/e-shell-window-actions.c index 2dd8228548..6807472b90 100644 --- a/shell/e-shell-window-actions.c +++ b/shell/e-shell-window-actions.c @@ -702,10 +702,13 @@ action_contents_cb (GtkAction *action, EShellWindow *shell_window) { #ifdef G_OS_WIN32 - /* On Windows, link to online help instead. See https://bugzilla.gnome.org/show_bug.cgi?id=576478 */ + /* On Windows, link to online help instead. + * See https://bugzilla.gnome.org/show_bug.cgi?id=576478 */ gchar *online_help_url; + online_help_url = g_strconcat ( - "http://library.gnome.org/users/evolution/", BASE_VERSION, NULL); + "http://library.gnome.org/users/evolution/", + BASE_VERSION, NULL); e_show_uri (GTK_WINDOW (shell_window), online_help_url); g_free (online_help_url); #else diff --git a/shell/e-shell-window-private.c b/shell/e-shell-window-private.c index 6518324ed1..54a1e8e3fd 100644 --- a/shell/e-shell-window-private.c +++ b/shell/e-shell-window-private.c @@ -259,7 +259,6 @@ e_shell_window_private_constructed (EShellWindow *shell_window) GtkPaned *paned; GtkWidget *widget; GtkWindow *window; - GObject *object; guint merge_id; const gchar *id; @@ -409,27 +408,39 @@ e_shell_window_private_constructed (EShellWindow *shell_window) settings = g_settings_new ("org.gnome.evolution.shell"); - object = G_OBJECT (shell_window); - g_settings_bind (settings, "default-component-id", object, "active-view", G_SETTINGS_BIND_DEFAULT); + g_settings_bind ( + settings, "default-component-id", + shell_window, "active-view", + G_SETTINGS_BIND_DEFAULT); - object = G_OBJECT (priv->content_pane); - g_settings_bind (settings, "folder-bar-width", object, "position", G_SETTINGS_BIND_DEFAULT); + g_settings_bind ( + settings, "folder-bar-width", + priv->content_pane, "position", + G_SETTINGS_BIND_DEFAULT); - object = G_OBJECT (shell_window); - g_settings_bind (settings, "sidebar-visible", object, "sidebar-visible", G_SETTINGS_BIND_DEFAULT); + g_settings_bind ( + settings, "sidebar-visible", + shell_window, "sidebar-visible", + G_SETTINGS_BIND_DEFAULT); - object = G_OBJECT (shell_window); - g_settings_bind (settings, "statusbar-visible", object, "taskbar-visible", G_SETTINGS_BIND_DEFAULT); + g_settings_bind ( + settings, "statusbar-visible", + shell_window, "taskbar-visible", + G_SETTINGS_BIND_DEFAULT); if (e_shell_get_express_mode (shell)) { e_shell_window_set_switcher_visible (shell_window, FALSE); } else { - object = G_OBJECT (shell_window); - g_settings_bind (settings, "buttons-visible", object, "switcher-visible", G_SETTINGS_BIND_DEFAULT); + g_settings_bind ( + settings, "buttons-visible", + shell_window, "switcher-visible", + G_SETTINGS_BIND_DEFAULT); } - object = G_OBJECT (shell_window); - g_settings_bind (settings, "toolbar-visible", object, "toolbar-visible", G_SETTINGS_BIND_DEFAULT); + g_settings_bind ( + settings, "toolbar-visible", + shell_window, "toolbar-visible", + G_SETTINGS_BIND_DEFAULT); /* Configure the initial size and position of the window by way * of either a user-supplied geometry string or the last recorded diff --git a/shell/test/e-test-shell-backend.c b/shell/test/e-test-shell-backend.c index 79f4aa876f..0d97308c48 100644 --- a/shell/test/e-test-shell-backend.c +++ b/shell/test/e-test-shell-backend.c @@ -28,10 +28,6 @@ #include "e-test-shell-view.h" -struct _ETestShellBackendPrivate { - gint placeholder; -}; - static gpointer parent_class; static GType test_shell_backend_type; @@ -159,7 +155,6 @@ test_shell_backend_class_init (ETestShellBackendClass *class) EShellBackendClass *shell_backend_class; parent_class = g_type_class_peek_parent (class); - g_type_class_add_private (class, sizeof (ETestShellBackendPrivate)); object_class = G_OBJECT_CLASS (class); object_class->constructed = test_shell_backend_constructed; @@ -178,9 +173,6 @@ test_shell_backend_class_init (ETestShellBackendClass *class) static void test_shell_backend_init (ETestShellBackend *test_shell_backend) { - test_shell_backend->priv = G_TYPE_INSTANCE_GET_PRIVATE ( - test_shell_backend, E_TYPE_TEST_SHELL_BACKEND, - ETestShellBackendPrivate); } GType diff --git a/shell/test/e-test-shell-view.c b/shell/test/e-test-shell-view.c index 825e27fa37..68d4ff9a7b 100644 --- a/shell/test/e-test-shell-view.c +++ b/shell/test/e-test-shell-view.c @@ -24,6 +24,10 @@ #include "shell/e-shell-content.h" #include "shell/e-shell-sidebar.h" +#define E_TEST_SHELL_VIEW_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE \ + ((obj), E_TYPE_TEST_SHELL_VIEW, ETestShellViewPrivate)) + struct _ETestShellViewPrivate { EActivity *activity; }; @@ -49,7 +53,7 @@ test_shell_view_dispose (GObject *object) { ETestShellViewPrivate *priv; - priv = E_TEST_SHELL_VIEW (object)->priv; + priv = E_TEST_SHELL_VIEW_GET_PRIVATE (object); if (priv->activity != NULL) { e_activity_set_state (priv->activity, E_ACTIVITY_COMPLETED); @@ -76,7 +80,7 @@ test_shell_view_constructed (GObject *object) /* Chain up to parent's constructed() method. */ G_OBJECT_CLASS (parent_class)->constructed (object); - priv = E_TEST_SHELL_VIEW (object)->priv; + priv = E_TEST_SHELL_VIEW_GET_PRIVATE (object); shell_view = E_SHELL_VIEW (object); shell_backend = e_shell_view_get_shell_backend (shell_view); @@ -123,9 +127,8 @@ test_shell_view_class_init (ETestShellViewClass *class, static void test_shell_view_init (ETestShellView *test_shell_view) { - test_shell_view->priv = G_TYPE_INSTANCE_GET_PRIVATE ( - test_shell_view, E_TYPE_TEST_SHELL_VIEW, - ETestShellViewPrivate); + test_shell_view->priv = + E_TEST_SHELL_VIEW_GET_PRIVATE (test_shell_view); } GType -- cgit v1.2.3