[ostree] repo: Use constructed, not constructor
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ostree] repo: Use constructed, not constructor
- Date: Thu, 5 Sep 2013 18:13:36 +0000 (UTC)
commit eb6f017ef85520f7fa489047e952a9d83895e8a8
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Thu Sep 5 00:05:04 2013 -0400
repo: Use constructed, not constructor
It's simpler to do this after the object is constructed, rather
than in the middle of construction.
https://bugzilla.gnome.org/show_bug.cgi?id=707582
src/libostree/ostree-repo.c | 20 ++++++--------------
1 files changed, 6 insertions(+), 14 deletions(-)
---
diff --git a/src/libostree/ostree-repo.c b/src/libostree/ostree-repo.c
index 48f707c..c314dfa 100644
--- a/src/libostree/ostree-repo.c
+++ b/src/libostree/ostree-repo.c
@@ -154,21 +154,13 @@ ostree_repo_get_property(GObject *object,
}
}
-static GObject *
-ostree_repo_constructor (GType gtype,
- guint n_properties,
- GObjectConstructParam *properties)
+static void
+ostree_repo_constructed (GObject *object)
{
- OstreeRepo *self;
- GObject *object;
- GObjectClass *parent_class;
-
- parent_class = G_OBJECT_CLASS (ostree_repo_parent_class);
- object = parent_class->constructor (gtype, n_properties, properties);
- self = (OstreeRepo*)object;
+ OstreeRepo *self = OSTREE_REPO (object);
g_assert (self->repodir != NULL);
-
+
self->tmp_dir = g_file_resolve_relative_path (self->repodir, "tmp");
self->pending_dir = g_file_resolve_relative_path (self->repodir, "tmp/pending");
self->local_heads_dir = g_file_resolve_relative_path (self->repodir, "refs/heads");
@@ -179,7 +171,7 @@ ostree_repo_constructor (GType gtype,
self->remote_cache_dir = g_file_get_child (self->repodir, "remote-cache");
self->config_file = g_file_get_child (self->repodir, "config");
- return object;
+ G_OBJECT_CLASS (ostree_repo_parent_class)->constructed (object);
}
static void
@@ -187,7 +179,7 @@ ostree_repo_class_init (OstreeRepoClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
- object_class->constructor = ostree_repo_constructor;
+ object_class->constructed = ostree_repo_constructed;
object_class->get_property = ostree_repo_get_property;
object_class->set_property = ostree_repo_set_property;
object_class->finalize = ostree_repo_finalize;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]