[gtk/matthiasc/for-master] builder-tool: Drop unneeded code



commit 9808df8e2aa1d3ab1fb865c6cb2398e1dbe22bb5
Author: Matthias Clasen <mclasen redhat com>
Date:   Sun Nov 1 11:14:24 2020 -0500

    builder-tool: Drop unneeded code
    
    We are rewriting the tree before simplifying it,
    so there is no need to 'keep things for rewriting'
    in the simplify phase.

 gtk/tools/gtk-builder-tool-simplify.c | 57 -----------------------------------
 1 file changed, 57 deletions(-)
---
diff --git a/gtk/tools/gtk-builder-tool-simplify.c b/gtk/tools/gtk-builder-tool-simplify.c
index ec4e8d5129..726c21f649 100644
--- a/gtk/tools/gtk-builder-tool-simplify.c
+++ b/gtk/tools/gtk-builder-tool-simplify.c
@@ -211,59 +211,6 @@ needs_explicit_setting (GParamSpec *pspec,
   return found;
 }
 
-static gboolean
-keep_for_rewrite (const char *class_name,
-                  const char *property_name,
-                  PropKind kind)
-{
-  struct _Prop {
-    const char *class;
-    const char *property;
-    PropKind kind;
-  } props[] = {
-    { "GtkPopover", "modal", PROP_KIND_OBJECT },
-    { "GtkActionBar", "pack-type", PROP_KIND_PACKING },
-    { "GtkHeaderBar", "pack-type", PROP_KIND_PACKING },
-    { "GtkPopoverMenu", "submenu", PROP_KIND_PACKING },
-    { "GtkToolbar", "expand", PROP_KIND_PACKING },
-    { "GtkToolbar", "homogeneous", PROP_KIND_PACKING },
-    { "GtkPaned", "resize", PROP_KIND_PACKING },
-    { "GtkPaned", "shrink", PROP_KIND_PACKING },
-    { "GtkOverlay", "measure", PROP_KIND_PACKING },
-    { "GtkOverlay", "clip-overlay", PROP_KIND_PACKING },
-    { "GtkGrid", "column", PROP_KIND_PACKING },
-    { "GtkGrid", "row", PROP_KIND_PACKING },
-    { "GtkGrid", "width", PROP_KIND_PACKING },
-    { "GtkGrid", "height", PROP_KIND_PACKING },
-    { "GtkStack", "name", PROP_KIND_PACKING },
-    { "GtkStack", "title", PROP_KIND_PACKING },
-    { "GtkStack", "icon-name", PROP_KIND_PACKING },
-    { "GtkStack", "needs-attention", PROP_KIND_PACKING },
-  };
-  gboolean found;
-  int k;
-  char *canonical_name;
-
-  canonical_name = g_strdup (property_name);
-  g_strdelimit (canonical_name, "_", '-');
-
-  found = FALSE;
-  for (k = 0; k < G_N_ELEMENTS (props); k++)
-    {
-      if (strcmp (class_name, props[k].class) == 0 &&
-          strcmp (canonical_name, props[k].property) == 0 &&
-          kind == props[k].kind)
-        {
-          found = TRUE;
-          break;
-        }
-    }
-
-  g_free (canonical_name);
-
-  return found;
-}
-
 static gboolean
 has_attribute (Element    *elt,
                const char *name,
@@ -657,10 +604,6 @@ property_can_be_omitted (Element      *element,
         property_name = (const char *)element->attribute_values[i];
     }
 
-  if (data->convert3to4 &&
-      keep_for_rewrite (class_name, property_name, kind))
-    return FALSE; /* keep, will be rewritten */
-
   if (translatable)
     return FALSE;
 


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