From c2f5b8bc64f9ac06b2dda8662924d88cc759718e Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Tue, 23 Aug 2011 20:42:15 +0100 Subject: gobject: Deserialize CONSTRUCT properties MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit While we have to give up deserializing CONSTRUCT_ONLY properties with JsonSerializable, CONSTRUCT properties should just be deserialized like any other property. Sadly, there's still a refuse in the json_gobject_new() code that skips CONSTRUCT properties along with CONSTRUCT_ONLY ones — a remnant of a period when we deserialized them both without JsonSerializable. https://bugzilla.gnome.org/show_bug.cgi?id=655526 --- json-glib/json-gobject.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'json-glib/json-gobject.c') diff --git a/json-glib/json-gobject.c b/json-glib/json-gobject.c index bb63467..d3b500b 100644 --- a/json-glib/json-gobject.c +++ b/json-glib/json-gobject.c @@ -198,13 +198,11 @@ json_gobject_new (GType gtype, members = json_object_get_members (object); members_left = NULL; - /* first pass: construct and construct-only properties; here - * we cannot use Serializable because we don't have an - * instance yet; we use the default implementation of - * json_deserialize_pspec() to deserialize known types + /* first pass: construct-only properties; here we cannot use Serializable + * because we don't have an instance yet; we use the default implementation + * of json_deserialize_pspec() to deserialize known types * - * FIXME - find a way to allow deserialization for these - * properties + * FIXME - find a way to allow deserialization for these properties */ construct_params = g_array_sized_new (FALSE, FALSE, sizeof (GParameter), n_members); @@ -307,8 +305,7 @@ json_gobject_new (GType gtype, continue; /* we should have dealt with these above */ - if ((pspec->flags & G_PARAM_CONSTRUCT_ONLY) || - (pspec->flags & G_PARAM_CONSTRUCT)) + if (pspec->flags & G_PARAM_CONSTRUCT_ONLY) continue; if (!(pspec->flags & G_PARAM_WRITABLE)) -- cgit v1.2.1