diff options
author | Matthias Clasen <mclasen@redhat.com> | 2020-11-01 20:39:43 -0500 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2020-11-01 23:09:26 -0500 |
commit | 44b36b632123bac043c4d5d607de275b900bca46 (patch) | |
tree | b95adcc8b9087123bc7c7b5ab85e796582b51ab5 /gtk/tools | |
parent | 4bd829e3e189e42ab195171eb7f9c0d912558f61 (diff) | |
download | gtk+-44b36b632123bac043c4d5d607de275b900bca46.tar.gz |
builder-tool: Stop rewriting GtkPopoverMenu
We no longer allow manual creation of GtkPopoverMenu,
translating individual properties is not going to
change that.
Diffstat (limited to 'gtk/tools')
-rw-r--r-- | gtk/tools/gtk-builder-tool-simplify.c | 84 |
1 files changed, 0 insertions, 84 deletions
diff --git a/gtk/tools/gtk-builder-tool-simplify.c b/gtk/tools/gtk-builder-tool-simplify.c index cd695979cd..d40556b0cb 100644 --- a/gtk/tools/gtk-builder-tool-simplify.c +++ b/gtk/tools/gtk-builder-tool-simplify.c @@ -1093,86 +1093,6 @@ rewrite_pack_type (Element *element, } static void -rewrite_child_prop_to_prop_child (Element *element, - MyParserData *data, - const char *child_prop, - const char *prop) -{ - Element *object = NULL; - Element *replaced = NULL; - GList *l, *ll; - - if (!g_str_equal (element->element_name, "child")) - return; - - for (l = element->children; l; l = l->next) - { - Element *elt = l->data; - - if (g_str_equal (elt->element_name, "object")) - object = elt; - - if (g_str_equal (elt->element_name, "packing")) - { - for (ll = elt->children; ll; ll = ll->next) - { - Element *elt2 = ll->data; - - if (g_str_equal (elt2->element_name, "property") && - has_attribute (elt2, "name", child_prop)) - { - replaced = elt2; - elt->children = g_list_remove (elt->children, replaced); - if (elt->children == NULL) - { - element->children = g_list_remove (element->children, elt); - free_element (elt); - } - break; - } - } - } - - if (replaced) - break; - } - - if (replaced) - { - Element *elt; - - elt = g_new0 (Element, 1); - elt->parent = element; - elt->element_name = g_strdup ("property"); - elt->attribute_names = g_new0 (char *, 2); - elt->attribute_names[0] = g_strdup ("name"); - elt->attribute_values = g_new0 (char *, 2); - elt->attribute_values[0] = g_strdup (prop); - elt->data = g_strdup (replaced->data); - - object->children = g_list_prepend (object->children, elt); - - free_element (replaced); - } -} - -static void -rewrite_child_prop_to_prop (Element *element, - MyParserData *data, - const char *child_prop, - const char *prop) -{ - GList *l; - - for (l = element->children; l; l = l->next) - { - Element *elt = l->data; - if (g_str_equal (elt->element_name, "child")) - rewrite_child_prop_to_prop_child (elt, data, child_prop, prop); - } -} - -static void rewrite_paned_child (Element *element, MyParserData *data, Element *child, @@ -1997,10 +1917,6 @@ rewrite_element (Element *element, rewrite_pack_type (element, data); if (element_is_object_or_template (element) && - g_str_equal (get_class_name (element), "GtkPopoverMenu")) - rewrite_child_prop_to_prop (element, data, "submenu", "name"); - - if (element_is_object_or_template (element) && g_str_equal (get_class_name (element), "GtkToolbar")) rewrite_toolbar (element, data); |