summaryrefslogtreecommitdiff
path: root/gtk/tools/gtk-builder-tool-simplify.c
diff options
context:
space:
mode:
authorLubomir Rintel <lkundrak@v3.sk>2019-05-30 11:29:50 +0200
committerLubomir Rintel <lkundrak@v3.sk>2019-05-30 11:39:09 +0200
commit1e7225aa1c20525da023f378405de0a8e4c9fc2d (patch)
tree372925eff9aca2815d21ebc68441bacac7716fba /gtk/tools/gtk-builder-tool-simplify.c
parentd691393f5f17a5ec56e14a46fe95bc111b646e6a (diff)
downloadgtk+-1e7225aa1c20525da023f378405de0a8e4c9fc2d.tar.gz
builder-tool: Set the parent of newly created GtkAssistantPage
...and its property. Otherwise simplify_element() blows up when looking up the hierarchy to determine a property type. $ gtk4-builder-tool simplify --3to4 /dev/stdin <<EOF > <?xml version="1.0" encoding="UTF-8"?> > <!-- Generated with glade 3.20.2 --> > <interface domain="nm-applet"> > <object class="GtkAssistant"> > <child> > <object class="GtkBox" id="confirm_page"> > </object> > <packing> > <property name="page_type">confirm</property> > <property name="complete">True</property> > </packing> > </child> > </object> > </interface> > EOF /dev/stdin: Packing property GtkAssistant::page_type not found /dev/stdin: Packing property GtkAssistant::complete not found Segmentation fault (core dumped)
Diffstat (limited to 'gtk/tools/gtk-builder-tool-simplify.c')
-rw-r--r--gtk/tools/gtk-builder-tool-simplify.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/gtk/tools/gtk-builder-tool-simplify.c b/gtk/tools/gtk-builder-tool-simplify.c
index 776496ca4a..5919d9d7f7 100644
--- a/gtk/tools/gtk-builder-tool-simplify.c
+++ b/gtk/tools/gtk-builder-tool-simplify.c
@@ -852,6 +852,7 @@ rewrite_assistant_child (Element *child, MyParserData *data)
new_object->attribute_values = g_new0 (char *, 2);
new_object->attribute_values[0] = g_strdup ("GtkAssistantPage");
new_object->children = packing->children;
+ new_object->parent = child;
packing->children = NULL;
prop = g_new0 (Element, 1);
@@ -861,6 +862,7 @@ rewrite_assistant_child (Element *child, MyParserData *data)
prop->attribute_values = g_new0 (char *, 2);
prop->attribute_values[0] = g_strdup ("child");
prop->children = g_list_append (prop->children, object);
+ prop->parent = new_object;
new_object->children = g_list_append (new_object->children, prop);
g_list_free (child->children);