[gnome-builder] xml-pack: use constructed instead of init to access context
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] xml-pack: use constructed instead of init to access context
- Date: Sat, 13 Jan 2018 03:13:46 +0000 (UTC)
commit 48c82b4d4d6f4eb925a2964547934c9568357acc
Author: Christian Hergert <chergert redhat com>
Date: Fri Jan 12 19:10:51 2018 -0800
xml-pack: use constructed instead of init to access context
src/plugins/xml-pack/ide-xml-tree-builder.c | 26 ++++++++++++++++++--------
1 file changed, 18 insertions(+), 8 deletions(-)
---
diff --git a/src/plugins/xml-pack/ide-xml-tree-builder.c b/src/plugins/xml-pack/ide-xml-tree-builder.c
index 168d871ec..d4ea3bd69 100644
--- a/src/plugins/xml-pack/ide-xml-tree-builder.c
+++ b/src/plugins/xml-pack/ide-xml-tree-builder.c
@@ -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);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]