diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2009-04-28 08:56:23 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2009-04-28 08:56:23 +0800 |
commit | a9e1c0f8e729915f756ee38854e20a8f04f3684b (patch) | |
tree | da2ec1ed7fe609e74cc5d89161c347099c45bd79 /calendar | |
parent | e9adae4dc73eacc543da135709ca57ff4304c665 (diff) | |
download | gsoc2013-evolution-a9e1c0f8e729915f756ee38854e20a8f04f3684b.tar.gz gsoc2013-evolution-a9e1c0f8e729915f756ee38854e20a8f04f3684b.tar.zst gsoc2013-evolution-a9e1c0f8e729915f756ee38854e20a8f04f3684b.zip |
Simplify action and action group lookups in CompEditor.
Diffstat (limited to 'calendar')
-rw-r--r-- | calendar/gui/dialogs/comp-editor.c | 30 |
1 files changed, 6 insertions, 24 deletions
diff --git a/calendar/gui/dialogs/comp-editor.c b/calendar/gui/dialogs/comp-editor.c index 5d842d673a..68b240cc25 100644 --- a/calendar/gui/dialogs/comp-editor.c +++ b/calendar/gui/dialogs/comp-editor.c @@ -1947,46 +1947,28 @@ GtkAction * comp_editor_get_action (CompEditor *editor, const gchar *action_name) { - GtkAction *action = NULL; - GList *iter; + GtkUIManager *ui_manager; g_return_val_if_fail (IS_COMP_EDITOR (editor), NULL); g_return_val_if_fail (action_name != NULL, NULL); - iter = gtk_ui_manager_get_action_groups (editor->priv->ui_manager); - while (iter != NULL && action == NULL) { - GtkActionGroup *action_group = iter->data; - - action = gtk_action_group_get_action ( - action_group, action_name); - iter = g_list_next (iter); - } - g_return_val_if_fail (action != NULL, NULL); + ui_manager = comp_editor_get_ui_manager (editor); - return action; + return e_lookup_action (ui_manager, action_name); } GtkActionGroup * comp_editor_get_action_group (CompEditor *editor, const gchar *group_name) { - GList *iter; + GtkUIManager *ui_manager; g_return_val_if_fail (IS_COMP_EDITOR (editor), NULL); g_return_val_if_fail (group_name != NULL, NULL); - iter = gtk_ui_manager_get_action_groups (editor->priv->ui_manager); - while (iter != NULL) { - GtkActionGroup *action_group = iter->data; - const gchar *name; - - name = gtk_action_group_get_name (action_group); - if (strcmp (name, group_name) == 0) - return action_group; - iter = g_list_next (iter); - } + ui_manager = comp_editor_get_ui_manager (editor); - g_return_val_if_reached (NULL); + return e_lookup_action_group (ui_manager, group_name); } GtkWidget * |