[gtk/simplify-toolbar] 3to4: Remove GtkToolbar::toolbar_style




commit ca9801f5fb50d749d89a69f0614bb85da6b17335
Author: Matthias Clasen <mclasen redhat com>
Date:   Tue Jan 5 13:57:47 2021 -0500

    3to4: Remove GtkToolbar::toolbar_style
    
    The property was removed (with the rest of the widget),
    so keeping it around in the ui file makes no sense.
    
    Testcase included.

 gtk/tools/gtk-builder-tool-simplify.c         | 14 ++++++++++++++
 testsuite/tools/simplify-data-3to4/toolbar.ui |  1 +
 2 files changed, 15 insertions(+)
---
diff --git a/gtk/tools/gtk-builder-tool-simplify.c b/gtk/tools/gtk-builder-tool-simplify.c
index 0541207a97..b61487c537 100644
--- a/gtk/tools/gtk-builder-tool-simplify.c
+++ b/gtk/tools/gtk-builder-tool-simplify.c
@@ -1723,6 +1723,20 @@ rewrite_toolbar (Element      *element,
 
   set_attribute_value (element, "class", "GtkBox");
 
+  for (l = element->children; l; l = l->next)
+    {
+      Element *child = l->data;
+
+      if (g_str_equal (child->element_name, "property") &&
+          (has_attribute (child, "name", "toolbar_style") ||
+           has_attribute (child, "name", "toolbar-style")))
+        {
+          element->children = g_list_remove (element->children, child);
+          free_element (child);
+          break;
+        }
+    }
+
   for (l = element->children; l; l = l->next)
     {
       Element *child = l->data;
diff --git a/testsuite/tools/simplify-data-3to4/toolbar.ui b/testsuite/tools/simplify-data-3to4/toolbar.ui
index 3f45466024..d695a41b6b 100644
--- a/testsuite/tools/simplify-data-3to4/toolbar.ui
+++ b/testsuite/tools/simplify-data-3to4/toolbar.ui
@@ -3,6 +3,7 @@
   <requires lib="gtk+" version="3.0"/>
   <object class="GtkToolbar">
     <property name="visible">1</property>
+    <property name="toolbar_style">both</property>
     <child>
       <object class="GtkToolButton">
         <property name="visible">1</property>


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