From 7b93db7ad996b29a6c576db33803029dc94e16fc Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Tue, 13 Nov 2007 10:45:23 +0000 Subject: Fix a couple of dumb typos in the GObject deserialization code We need to skip if the CONSTRUCT_ONLY flag is set, not unset. We also need to copy the value from the JSON node into the target GValue, not the other way around. --- json-glib/json-gobject.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'json-glib/json-gobject.c') diff --git a/json-glib/json-gobject.c b/json-glib/json-gobject.c index 9388fef..c5dfe36 100644 --- a/json-glib/json-gobject.c +++ b/json-glib/json-gobject.c @@ -182,11 +182,13 @@ json_deserialize_pspec (GValue *value, case G_TYPE_INT: case G_TYPE_DOUBLE: case G_TYPE_STRING: - g_value_copy (value, &node_value); + g_value_copy (&node_value, value); retval = TRUE; + break; case G_TYPE_CHAR: g_value_set_char (value, (gchar) g_value_get_int (&node_value)); + retval = TRUE; break; case G_TYPE_UINT: @@ -416,7 +418,7 @@ json_construct_gobject (GType gtype, if (!pspec) continue; - if (!(pspec->flags & G_PARAM_CONSTRUCT_ONLY)) + if (pspec->flags & G_PARAM_CONSTRUCT_ONLY) continue; if (!(pspec->flags & G_PARAM_WRITABLE)) -- cgit v1.2.1