[gtk/matthiasc/for-master: 24/25] builder-tool: Stop rewriting GtkPopoverMenu
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/matthiasc/for-master: 24/25] builder-tool: Stop rewriting GtkPopoverMenu
- Date: Mon, 2 Nov 2020 03:30:56 +0000 (UTC)
commit bd294e72ced13dafa3ad2a389fe4b17c0dc7fbea
Author: Matthias Clasen <mclasen redhat com>
Date: Sun Nov 1 20:39:43 2020 -0500
builder-tool: Stop rewriting GtkPopoverMenu
We no longer allow manual creation of GtkPopoverMenu,
translating individual properties is not going to
change that.
gtk/tools/gtk-builder-tool-simplify.c | 84 -----------------------------------
1 file changed, 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
@@ -1092,86 +1092,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,
@@ -1996,10 +1916,6 @@ rewrite_element (Element *element,
g_str_equal (get_class_name (element), "GtkHeaderBar")))
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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]