[gtk/kill-tree-menu: 27/39] inspector: Remove menu special-casing



commit 3841a7155583e83d383ba941583c3dbeb3430330
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Dec 27 08:48:03 2019 -0500

    inspector: Remove menu special-casing

 gtk/inspector/object-tree.c | 24 ------------------------
 gtk/inspector/prop-editor.c | 11 +----------
 2 files changed, 1 insertion(+), 34 deletions(-)
---
diff --git a/gtk/inspector/object-tree.c b/gtk/inspector/object-tree.c
index e0e1f4c2ff..cfc41987f5 100644
--- a/gtk/inspector/object-tree.c
+++ b/gtk/inspector/object-tree.c
@@ -111,14 +111,6 @@ object_tree_widget_get_parent (GObject *object)
   return G_OBJECT (gtk_widget_get_parent (GTK_WIDGET (object)));
 }
 
-static GObject *
-object_tree_menu_get_parent (GObject *object)
-{
-  GtkWidget *w = gtk_menu_get_attach_widget (GTK_MENU (object));
-
-  return w ? G_OBJECT (w) : NULL;
-}
-
 static GListModel *
 object_tree_widget_get_children (GObject *object)
 {
@@ -237,12 +229,6 @@ list_model_for_properties (GObject     *object,
   return result;
 }
 
-static GListModel *
-object_tree_menu_item_get_children (GObject *object)
-{
-  return list_model_for_properties (object, (const char *[2]) { "submenu", NULL });
-}
-
 static GListModel *
 object_tree_combo_box_get_children (GObject *object)
 {
@@ -517,16 +503,6 @@ static const ObjectTreeClassFuncs object_tree_class_funcs[] = {
     object_tree_widget_get_parent,
     object_tree_combo_box_get_children
   },
-  {
-    gtk_menu_item_get_type,
-    object_tree_widget_get_parent,
-    object_tree_menu_item_get_children
-  },
-  {
-    gtk_menu_get_type,
-    object_tree_menu_get_parent,
-    object_tree_widget_get_children
-  },
   {
     gtk_widget_get_type,
     object_tree_widget_get_parent,
diff --git a/gtk/inspector/prop-editor.c b/gtk/inspector/prop-editor.c
index 220d984e78..6c7471b0e3 100644
--- a/gtk/inspector/prop-editor.c
+++ b/gtk/inspector/prop-editor.c
@@ -1251,15 +1251,6 @@ attribute_editor (GObject                *object,
   return box;
 }
 
-static GtkWidget *
-action_ancestor (GtkWidget *widget)
-{
-  if (GTK_IS_MENU (widget))
-    return gtk_menu_get_attach_widget (GTK_MENU (widget));
-  else
-    return gtk_widget_get_parent (widget);
-}
-
 static GObject *
 find_action_owner (GtkActionable *actionable)
 {
@@ -1291,7 +1282,7 @@ find_action_owner (GtkActionable *actionable)
       if (muxer && gtk_action_muxer_find (muxer, full_name, NULL))
         return (GObject *)widget;
 
-      widget = action_ancestor (widget);
+      widget = gtk_widget_get_parent (widget);
     }
 
   return NULL;


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