diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2011-12-01 10:53:20 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2012-02-20 23:04:25 +0800 |
commit | 23f5773903d64a554d977ae7d0ebbaca73528f1f (patch) | |
tree | 104e1a59da8bf96b004bce204b79f47bbe0a6d13 /widgets/misc/e-menu-tool-button.c | |
parent | 49bc4c2d765ee1780c23fdc9f42152850dabb220 (diff) | |
download | gsoc2013-evolution-23f5773903d64a554d977ae7d0ebbaca73528f1f.tar.gz gsoc2013-evolution-23f5773903d64a554d977ae7d0ebbaca73528f1f.tar.zst gsoc2013-evolution-23f5773903d64a554d977ae7d0ebbaca73528f1f.zip |
Coding style and whitespace cleanup.
Diffstat (limited to 'widgets/misc/e-menu-tool-button.c')
-rw-r--r-- | widgets/misc/e-menu-tool-button.c | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/widgets/misc/e-menu-tool-button.c b/widgets/misc/e-menu-tool-button.c index 5a052a1844..c2a68d0c05 100644 --- a/widgets/misc/e-menu-tool-button.c +++ b/widgets/misc/e-menu-tool-button.c @@ -25,16 +25,19 @@ #include "e-menu-tool-button.h" +#define E_MENU_TOOL_BUTTON_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE \ + ((obj), E_TYPE_MENU_TOOL_BUTTON, EMenuToolButtonPrivate)) + +struct _EMenuToolButtonPrivate { + gchar *prefer_item; +}; + enum { PROP_0, PROP_PREFER_ITEM }; -struct _EMenuToolButtonPrivate -{ - gchar *prefer_item; -}; - G_DEFINE_TYPE ( EMenuToolButton, e_menu_tool_button, @@ -73,8 +76,9 @@ menu_tool_button_get_prefer_menu_item (GtkMenuToolButton *menu_tool_button) if (children == NULL) return NULL; - prefer_item = e_menu_tool_button_get_prefer_item (E_MENU_TOOL_BUTTON (menu_tool_button)); - if (prefer_item && *prefer_item) { + prefer_item = e_menu_tool_button_get_prefer_item ( + E_MENU_TOOL_BUTTON (menu_tool_button)); + if (prefer_item != NULL && *prefer_item != '\0') { GtkAction *action; GList *iter; @@ -84,7 +88,8 @@ menu_tool_button_get_prefer_menu_item (GtkMenuToolButton *menu_tool_button) if (!item) continue; - action = gtk_activatable_get_related_action (GTK_ACTIVATABLE (item)); + action = gtk_activatable_get_related_action ( + GTK_ACTIVATABLE (item)); if (action && g_strcmp0 (gtk_action_get_name (action), prefer_item) == 0) break; else if (!action && g_strcmp0 (gtk_widget_get_name (GTK_WIDGET (item)), prefer_item) == 0) @@ -227,8 +232,7 @@ e_menu_tool_button_class_init (EMenuToolButtonClass *class) static void e_menu_tool_button_init (EMenuToolButton *button) { - button->priv = G_TYPE_INSTANCE_GET_PRIVATE ( - button, E_TYPE_MENU_TOOL_BUTTON, EMenuToolButtonPrivate); + button->priv = E_MENU_TOOL_BUTTON_GET_PRIVATE (button); button->priv->prefer_item = NULL; @@ -245,7 +249,7 @@ e_menu_tool_button_new (const gchar *label) void e_menu_tool_button_set_prefer_item (EMenuToolButton *button, - const gchar *prefer_item) + const gchar *prefer_item) { g_return_if_fail (button != NULL); g_return_if_fail (E_IS_MENU_TOOL_BUTTON (button)); |