[gtk/shortcuts-rebased-again: 146/171] shortcutaction: Just use gtk_widget_activate_action
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/shortcuts-rebased-again: 146/171] shortcutaction: Just use gtk_widget_activate_action
- Date: Mon, 24 Jun 2019 23:16:46 +0000 (UTC)
commit f6f8f4b7429c9ec7b308bdf542afe0505ea05828
Author: Matthias Clasen <mclasen redhat com>
Date: Sun Jun 23 16:18:24 2019 +0000
shortcutaction: Just use gtk_widget_activate_action
We can just rely on this, no need to do manual
action group juggling here.
gtk/gtkshortcutaction.c | 28 ++++------------------------
1 file changed, 4 insertions(+), 24 deletions(-)
---
diff --git a/gtk/gtkshortcutaction.c b/gtk/gtkshortcutaction.c
index dfc999d44e..8eb55c6062 100644
--- a/gtk/gtkshortcutaction.c
+++ b/gtk/gtkshortcutaction.c
@@ -971,31 +971,11 @@ gtk_action_action_activate (GtkShortcutAction *action,
GVariant *args)
{
GtkActionAction *self = (GtkActionAction *) action;
- GActionGroup *action_group;
- const GVariantType *parameter_type;
- gboolean enabled;
+ GActionGroup *group;
- action_group = G_ACTION_GROUP (_gtk_widget_get_action_muxer (widget, FALSE));
- if (action_group == NULL)
- return FALSE;
-
- if (!g_action_group_query_action (action_group, self->name, &enabled, ¶meter_type, NULL, NULL, NULL))
- return FALSE;
-
- if (!enabled)
- return FALSE;
-
- /* We found an action with the correct name and it's enabled.
- * This is the action that we are going to try to invoke.
- *
- * There is still the possibility that the args don't
- * match the expected parameter type. In that case, we will print
- * a warning.
- */
- if (!gtk_shortcut_trigger_check_parameter_type (args, parameter_type))
- return FALSE;
-
- g_action_group_activate_action (action_group, self->name, args);
+ group = G_ACTION_GROUP (_gtk_widget_get_action_muxer (widget, FALSE));
+ if (group)
+ g_action_group_activate_action (group, self->name, args);
return TRUE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]