summaryrefslogtreecommitdiff
path: root/json-glib/json-gobject.c
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@linux.intel.com>2011-08-23 20:42:15 +0100
committerEmmanuele Bassi <ebassi@linux.intel.com>2011-08-23 20:42:15 +0100
commitc2f5b8bc64f9ac06b2dda8662924d88cc759718e (patch)
treecabd60183519378fb298b3907ac76789b78eaa05 /json-glib/json-gobject.c
parentbcfac335a8e4086ff6afa5f267f9886a4d1b6370 (diff)
downloadjson-glib-c2f5b8bc64f9ac06b2dda8662924d88cc759718e.tar.gz
gobject: Deserialize CONSTRUCT properties
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
Diffstat (limited to 'json-glib/json-gobject.c')
-rw-r--r--json-glib/json-gobject.c13
1 files changed, 5 insertions, 8 deletions
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))