modelbutton: Remove accel poking

Stop manually poking GtkApplication for accels.
GtkApplication already feeds them into the action
muxer machinery, so that is where will get them.
This commit is contained in:
Matthias Clasen 2020-03-23 14:46:20 -04:00
parent 6e8c78714d
commit 1db5382c6d

View File

@ -980,48 +980,6 @@ gtk_model_button_finalize (GObject *object)
G_OBJECT_CLASS (gtk_model_button_parent_class)->finalize (object);
}
static void
gtk_model_button_root (GtkWidget *widget)
{
GtkModelButton *self = GTK_MODEL_BUTTON (widget);
GtkRoot *root;
GtkApplication *app;
const char *action_name;
GVariant *action_target;
GTK_WIDGET_CLASS (gtk_model_button_parent_class)->root (widget);
if (!self->accel)
return;
root = gtk_widget_get_root (widget);
if (!GTK_IS_WINDOW (root))
return;
app = gtk_window_get_application (GTK_WINDOW (root));
if (!app)
return;
action_name = gtk_actionable_get_action_name (GTK_ACTIONABLE (widget));
action_target = gtk_actionable_get_action_target_value (GTK_ACTIONABLE (widget));
if (action_name)
{
char *detailed;
char **accels;
detailed = g_action_print_detailed_name (action_name, action_target);
accels = gtk_application_get_accels_for_action (app, detailed);
update_accel (self, accels[0]);
g_strfreev (accels);
g_free (detailed);
}
}
static gboolean
gtk_model_button_focus (GtkWidget *widget,
GtkDirectionType direction)
@ -1094,7 +1052,6 @@ gtk_model_button_class_init (GtkModelButtonClass *class)
widget_class->state_flags_changed = gtk_model_button_state_flags_changed;
widget_class->direction_changed = gtk_model_button_direction_changed;
widget_class->focus = gtk_model_button_focus;
widget_class->root = gtk_model_button_root;
widget_class->get_accessible = gtk_model_button_get_accessible;
/**