Commit 48c82b4d authored by Christian Hergert's avatar Christian Hergert
Browse files

xml-pack: use constructed instead of init to access context

parent 64553177
......@@ -523,23 +523,33 @@ ide_xml_tree_builder_finalize (GObject *object)
G_OBJECT_CLASS (ide_xml_tree_builder_parent_class)->finalize (object);
}
static void
ide_xml_tree_builder_constructed (GObject *object)
{
IdeXmlTreeBuilder *self = (IdeXmlTreeBuilder *)object;
IdeContext *context;
G_OBJECT_CLASS (ide_xml_tree_builder_parent_class)->constructed (object);
context = ide_object_get_context (IDE_OBJECT (self));
g_assert (IDE_IS_CONTEXT (context));
self->parser = g_object_new (IDE_TYPE_XML_PARSER,
"context", context,
NULL);
self->validator = ide_xml_validator_new (context);
}
static void
ide_xml_tree_builder_class_init (IdeXmlTreeBuilderClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->constructed = ide_xml_tree_builder_constructed;
object_class->finalize = ide_xml_tree_builder_finalize;
}
static void
ide_xml_tree_builder_init (IdeXmlTreeBuilder *self)
{
IdeContext *context;
context = ide_object_get_context (IDE_OBJECT (self));
self->parser = g_object_new (IDE_TYPE_XML_PARSER,
"context", context,
NULL);
self->validator = ide_xml_validator_new (context);
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment