From 198ed839424dc7791d22dede152f4d7abc16a8b2 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Tue, 13 Nov 2007 10:51:31 +0000 Subject: Use the fallback value-to-node generator even for serializables To avoid reimplementing the same code all over again, if the implementation of the serialize_property virtual function of JsonSerializable returns NULL we will fall back to the simple value-to-node generator we provide for non-serializable classes. --- tests/test-07.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) (limited to 'tests') diff --git a/tests/test-07.c b/tests/test-07.c index fe5dafa..0dda4f6 100644 --- a/tests/test-07.c +++ b/tests/test-07.c @@ -98,7 +98,7 @@ test_object_serialize_property (JsonSerializable *serializable, const GValue *value, GParamSpec *pspec) { - JsonNode *retval; + JsonNode *retval = NULL; if (strcmp (name, "blah") == 0) { @@ -123,17 +123,6 @@ test_object_serialize_property (JsonSerializable *serializable, test_boxed_free (boxed); } - else - { - GValue copy = { 0, }; - - retval = json_node_new (JSON_NODE_VALUE); - - g_value_init (©, G_PARAM_SPEC_VALUE_TYPE (pspec)); - g_value_copy (value, ©); - json_node_set_value (retval, ©); - g_value_unset (©); - } return retval; } -- cgit v1.2.1