From 1e7225aa1c20525da023f378405de0a8e4c9fc2d Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Thu, 30 May 2019 11:29:50 +0200 Subject: [PATCH] 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 < > > > > > > > > confirm > True > > > > > EOF /dev/stdin: Packing property GtkAssistant::page_type not found /dev/stdin: Packing property GtkAssistant::complete not found Segmentation fault (core dumped) --- gtk/tools/gtk-builder-tool-simplify.c | 2 ++ 1 file changed, 2 insertions(+) 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);