diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2009-09-02 09:12:44 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2009-09-02 09:12:44 +0800 |
commit | 8962868ff902e58456c545478e62796029d1fe5c (patch) | |
tree | d43efa77beba51f716a259a3538dd55a38711923 /shell | |
parent | 6b2a55be48922c9fe5c94d654a4d463f23a428f2 (diff) | |
download | gsoc2013-evolution-8962868ff902e58456c545478e62796029d1fe5c.tar gsoc2013-evolution-8962868ff902e58456c545478e62796029d1fe5c.tar.gz gsoc2013-evolution-8962868ff902e58456c545478e62796029d1fe5c.tar.bz2 gsoc2013-evolution-8962868ff902e58456c545478e62796029d1fe5c.tar.lz gsoc2013-evolution-8962868ff902e58456c545478e62796029d1fe5c.tar.xz gsoc2013-evolution-8962868ff902e58456c545478e62796029d1fe5c.tar.zst gsoc2013-evolution-8962868ff902e58456c545478e62796029d1fe5c.zip |
Relax the EBinding API to reduce GObject casting.
Also make it more fault-tolerant by warning about non-existent
property names instead of just crashing.
Diffstat (limited to 'shell')
-rw-r--r-- | shell/e-shell-content.c | 24 | ||||
-rw-r--r-- | shell/e-shell-window-actions.c | 24 | ||||
-rw-r--r-- | shell/e-shell-window-private.c | 40 |
3 files changed, 44 insertions, 44 deletions
diff --git a/shell/e-shell-content.c b/shell/e-shell-content.c index 4e32765e35..15c1a93fa9 100644 --- a/shell/e-shell-content.c +++ b/shell/e-shell-content.c @@ -567,14 +567,14 @@ shell_content_constructed (GObject *object) action = E_SHELL_WINDOW_ACTION_SEARCH_CLEAR (shell_window); e_binding_new ( - G_OBJECT (action), "sensitive", - G_OBJECT (widget), "secondary-icon-sensitive"); + action, "sensitive", + widget, "secondary-icon-sensitive"); e_binding_new ( - G_OBJECT (action), "stock-id", - G_OBJECT (widget), "secondary-icon-stock"); + action, "stock-id", + widget, "secondary-icon-stock"); e_binding_new ( - G_OBJECT (action), "tooltip", - G_OBJECT (widget), "secondary-icon-tooltip-text"); + action, "tooltip", + widget, "secondary-icon-tooltip-text"); action = E_SHELL_WINDOW_ACTION_SEARCH_EXECUTE (shell_window); g_signal_connect ( @@ -583,14 +583,14 @@ shell_content_constructed (GObject *object) action = E_SHELL_WINDOW_ACTION_SEARCH_OPTIONS (shell_window); e_binding_new ( - G_OBJECT (action), "sensitive", - G_OBJECT (widget), "primary-icon-sensitive"); + action, "sensitive", + widget, "primary-icon-sensitive"); e_binding_new ( - G_OBJECT (action), "stock-id", - G_OBJECT (widget), "primary-icon-stock"); + action, "stock-id", + widget, "primary-icon-stock"); e_binding_new ( - G_OBJECT (action), "tooltip", - G_OBJECT (widget), "primary-icon-tooltip-text"); + action, "tooltip", + widget, "primary-icon-tooltip-text"); widget = shell_content->priv->search_bar; gtk_size_group_add_widget (size_group, widget); diff --git a/shell/e-shell-window-actions.c b/shell/e-shell-window-actions.c index 4fc8448518..54cd47ffa2 100644 --- a/shell/e-shell-window-actions.c +++ b/shell/e-shell-window-actions.c @@ -1875,28 +1875,28 @@ e_shell_window_actions_init (EShellWindow *shell_window) g_object_set (ACTION (SEND_RECEIVE), "is-important", TRUE, NULL); e_binding_new ( - G_OBJECT (ACTION (SHOW_SIDEBAR)), "active", - G_OBJECT (ACTION (SHOW_SWITCHER)), "sensitive"); + ACTION (SHOW_SIDEBAR), "active", + ACTION (SHOW_SWITCHER), "sensitive"); e_binding_new ( - G_OBJECT (ACTION (SHOW_SIDEBAR)), "active", - G_OBJECT (ACTION (SWITCHER_STYLE_BOTH)), "sensitive"); + ACTION (SHOW_SIDEBAR), "active", + ACTION (SWITCHER_STYLE_BOTH), "sensitive"); e_binding_new ( - G_OBJECT (ACTION (SHOW_SIDEBAR)), "active", - G_OBJECT (ACTION (SWITCHER_STYLE_ICONS)), "sensitive"); + ACTION (SHOW_SIDEBAR), "active", + ACTION (SWITCHER_STYLE_ICONS), "sensitive"); e_binding_new ( - G_OBJECT (ACTION (SHOW_SIDEBAR)), "active", - G_OBJECT (ACTION (SWITCHER_STYLE_TEXT)), "sensitive"); + ACTION (SHOW_SIDEBAR), "active", + ACTION (SWITCHER_STYLE_TEXT), "sensitive"); e_binding_new ( - G_OBJECT (ACTION (SHOW_SIDEBAR)), "active", - G_OBJECT (ACTION (SWITCHER_STYLE_USER)), "sensitive"); + ACTION (SHOW_SIDEBAR), "active", + ACTION (SWITCHER_STYLE_USER), "sensitive"); e_binding_new ( - G_OBJECT (ACTION (SHOW_SIDEBAR)), "active", - G_OBJECT (ACTION (SWITCHER_MENU)), "sensitive"); + ACTION (SHOW_SIDEBAR), "active", + ACTION (SWITCHER_MENU), "sensitive"); } GtkWidget * diff --git a/shell/e-shell-window-private.c b/shell/e-shell-window-private.c index 6ee997ddef..2cf24ba061 100644 --- a/shell/e-shell-window-private.c +++ b/shell/e-shell-window-private.c @@ -359,56 +359,56 @@ e_shell_window_private_constructed (EShellWindow *shell_window) action_group = ACTION_GROUP (LOCKDOWN_PRINTING); e_binding_new_with_negation ( - G_OBJECT (shell_settings), "disable-printing", - G_OBJECT (action_group), "sensitive"); + shell_settings, "disable-printing", + action_group, "sensitive"); action_group = ACTION_GROUP (LOCKDOWN_PRINT_SETUP); e_binding_new_with_negation ( - G_OBJECT (shell_settings), "disable-print-setup", - G_OBJECT (action_group), "sensitive"); + shell_settings, "disable-print-setup", + action_group, "sensitive"); action_group = ACTION_GROUP (LOCKDOWN_SAVE_TO_DISK); e_binding_new_with_negation ( - G_OBJECT (shell_settings), "disable-save-to-disk", - G_OBJECT (action_group), "sensitive"); + shell_settings, "disable-save-to-disk", + action_group, "sensitive"); /* Bind GObject properties to GObject properties. */ action = ACTION (SEND_RECEIVE); e_binding_new ( - G_OBJECT (shell), "online", - G_OBJECT (action), "sensitive"); + shell, "online", + action, "sensitive"); action = ACTION (WORK_OFFLINE); e_binding_new ( - G_OBJECT (shell), "online", - G_OBJECT (action), "visible"); + shell, "online", + action, "visible"); e_binding_new ( - G_OBJECT (shell), "network-available", - G_OBJECT (action), "sensitive"); + shell, "network-available", + action, "sensitive"); action = ACTION (WORK_ONLINE); e_binding_new_with_negation ( - G_OBJECT (shell), "online", - G_OBJECT (action), "visible"); + shell, "online", + action, "visible"); e_binding_new ( - G_OBJECT (shell), "network-available", - G_OBJECT (action), "sensitive"); + shell, "network-available", + action, "sensitive"); e_binding_new ( - G_OBJECT (shell), "online", - G_OBJECT (priv->online_button), "online"); + shell, "online", + priv->online_button, "online"); e_binding_new ( - G_OBJECT (shell), "network-available", - G_OBJECT (priv->online_button), "sensitive"); + shell, "network-available", + priv->online_button, "sensitive"); /* Bind GObject properties to GConf keys. */ |