[gtk/wip/matthiasc/shortcut-4: 69/85] modelbutton: Remove accel poking



commit 1db5382c6d54a27af91dcf7483209bbb6f409b24
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon Mar 23 14:46:20 2020 -0400

    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.

 gtk/gtkmodelbutton.c | 43 -------------------------------------------
 1 file changed, 43 deletions(-)
---
diff --git a/gtk/gtkmodelbutton.c b/gtk/gtkmodelbutton.c
index 49b69b28e8..54b1bf34b8 100644
--- a/gtk/gtkmodelbutton.c
+++ b/gtk/gtkmodelbutton.c
@@ -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;
 
   /**


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]