diff options
author | Emmanuele Bassi <ebassi@openedhand.com> | 2007-11-13 10:45:23 +0000 |
---|---|---|
committer | Emmanuele Bassi <ebassi@openedhand.com> | 2007-11-13 10:45:23 +0000 |
commit | 7b93db7ad996b29a6c576db33803029dc94e16fc (patch) | |
tree | 9f93abd4947c9385e0d7fbcc730e52cf74128284 /json-glib/json-gobject.c | |
parent | 9e61004365982017bfe9b76889e2a7d1a0320350 (diff) | |
download | json-glib-7b93db7ad996b29a6c576db33803029dc94e16fc.tar.gz |
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.
Diffstat (limited to 'json-glib/json-gobject.c')
-rw-r--r-- | json-glib/json-gobject.c | 6 |
1 files changed, 4 insertions, 2 deletions
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)) |