From 1fa54c12337433455d7e9a65779b28d927050896 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 28 Jun 2010 13:44:43 -0500 Subject: Adding a new testing lib. --- tests/json-loader.c | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 tests/json-loader.c (limited to 'tests/json-loader.c') diff --git a/tests/json-loader.c b/tests/json-loader.c new file mode 100644 index 0000000..c2483b6 --- /dev/null +++ b/tests/json-loader.c @@ -0,0 +1,4 @@ + +#include "json-loader.h" + +const gchar * myval = "FIVE"; -- cgit v1.2.3 From 71e4cc90f10559cc675d696c773ed2825a2cbb8d Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 28 Jun 2010 15:55:53 -0500 Subject: Moving the JSON parsing code into the library. --- tests/json-loader.c | 87 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 86 insertions(+), 1 deletion(-) (limited to 'tests/json-loader.c') diff --git a/tests/json-loader.c b/tests/json-loader.c index c2483b6..7cfc7d9 100644 --- a/tests/json-loader.c +++ b/tests/json-loader.c @@ -1,4 +1,89 @@ #include "json-loader.h" -const gchar * myval = "FIVE"; +static void +set_props (DbusmenuMenuitem * mi, JsonObject * node) +{ + if (node == NULL) return; + + GList * members = NULL; + for (members = json_object_get_members(node); members != NULL; members = g_list_next(members)) { + const gchar * member = members->data; + + if (!g_strcmp0(member, "id")) { continue; } + if (!g_strcmp0(member, "submenu")) { continue; } + + JsonNode * lnode = json_object_get_member(node, member); + if (JSON_NODE_TYPE(lnode) != JSON_NODE_VALUE) { continue; } + + GValue value = {0}; + json_node_get_value(lnode, &value); + dbusmenu_menuitem_property_set_value(mi, member, &value); + g_value_unset(&value); + } + + return; +} + +DbusmenuMenuitem * +dbusmenu_json_build_from_node (const JsonNode * cnode) +{ + JsonNode * node = (JsonNode *)cnode; /* To match the jsonglib API :( */ + + if (node == NULL) return NULL; + if (JSON_NODE_TYPE(node) != JSON_NODE_OBJECT) return NULL; + + JsonObject * layout = json_node_get_object(node); + + DbusmenuMenuitem * local = NULL; + if (json_object_has_member(layout, "id")) { + JsonNode * node = json_object_get_member(layout, "id"); + g_return_val_if_fail(JSON_NODE_TYPE(node) == JSON_NODE_VALUE, NULL); + local = dbusmenu_menuitem_new_with_id(json_node_get_int(node)); + } else { + local = dbusmenu_menuitem_new(); + } + + set_props(local, layout); + + if (json_object_has_member(layout, "submenu")) { + JsonNode * node = json_object_get_member(layout, "submenu"); + g_return_val_if_fail(JSON_NODE_TYPE(node) == JSON_NODE_ARRAY, local); + JsonArray * array = json_node_get_array(node); + guint count; + for (count = 0; count < json_array_get_length(array); count++) { + DbusmenuMenuitem * child = dbusmenu_json_build_from_node(json_array_get_element(array, count)); + if (child != NULL) { + dbusmenu_menuitem_child_append(local, child); + } + } + } + + /* g_debug("Layout to menu return: 0x%X", (unsigned int)local); */ + return local; +} + +DbusmenuMenuitem * +dbusmenu_json_build_from_file (const gchar * filename) +{ + JsonParser * parser = json_parser_new(); + + GError * error = NULL; + if (!json_parser_load_from_file(parser, filename, &error)) { + g_warning("Failed parsing file %s because: %s", filename, error->message); + g_error_free(error); + return NULL; + } + + JsonNode * root_node = json_parser_get_root(parser); + if (JSON_NODE_TYPE(root_node) != JSON_NODE_OBJECT) { + g_warning("Root node is not an object, fail. It's an: %s", json_node_type_name(root_node)); + return NULL; + } + + DbusmenuMenuitem * mi = dbusmenu_json_build_from_node(root_node); + + g_object_unref(parser); + + return mi; +} -- cgit v1.2.3 From fa34ff87fd2149d3c89c8b00fa8713b8a2b9b563 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 28 Jun 2010 16:04:48 -0500 Subject: Make the code behave exactly the same but with a function call in the middle. --- tests/json-loader.c | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) (limited to 'tests/json-loader.c') diff --git a/tests/json-loader.c b/tests/json-loader.c index 7cfc7d9..94df096 100644 --- a/tests/json-loader.c +++ b/tests/json-loader.c @@ -1,6 +1,13 @@ #include "json-loader.h" +static GValue * +handle_complex_types (JsonNode * node) +{ + + return NULL; +} + static void set_props (DbusmenuMenuitem * mi, JsonObject * node) { @@ -14,12 +21,20 @@ set_props (DbusmenuMenuitem * mi, JsonObject * node) if (!g_strcmp0(member, "submenu")) { continue; } JsonNode * lnode = json_object_get_member(node, member); - if (JSON_NODE_TYPE(lnode) != JSON_NODE_VALUE) { continue; } - GValue value = {0}; - json_node_get_value(lnode, &value); - dbusmenu_menuitem_property_set_value(mi, member, &value); - g_value_unset(&value); + if (JSON_NODE_TYPE(lnode) != JSON_NODE_VALUE) { + GValue * value = handle_complex_types(lnode); + if (value != NULL) { + dbusmenu_menuitem_property_set_value(mi, member, value); + g_value_unset(value); + g_free(value); + } + } else { + GValue value = {0}; + json_node_get_value(lnode, &value); + dbusmenu_menuitem_property_set_value(mi, member, &value); + g_value_unset(&value); + } } return; -- cgit v1.2.3 From fc3ce0689dacf6396b54e51f6a9c9f24a4a6b9ef Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 28 Jun 2010 16:19:57 -0500 Subject: Restructuring a bit to make it more reusable. --- tests/json-loader.c | 37 ++++++++++++++++++++++++------------- 1 file changed, 24 insertions(+), 13 deletions(-) (limited to 'tests/json-loader.c') diff --git a/tests/json-loader.c b/tests/json-loader.c index 94df096..aa11aa5 100644 --- a/tests/json-loader.c +++ b/tests/json-loader.c @@ -2,9 +2,27 @@ #include "json-loader.h" static GValue * -handle_complex_types (JsonNode * node) +node2value (JsonNode * node) { + if (node == NULL) { + return NULL; + } + + GValue * value = g_new0(GValue, 1); + if (JSON_NODE_TYPE(node) == JSON_NODE_VALUE) { + json_node_get_value(node, value); + return value; + } + + if (JSON_NODE_TYPE(node) == JSON_NODE_ARRAY) { + } + + + if (JSON_NODE_TYPE(node) == JSON_NODE_OBJECT) { + } + + g_free(value); return NULL; } @@ -21,19 +39,12 @@ set_props (DbusmenuMenuitem * mi, JsonObject * node) if (!g_strcmp0(member, "submenu")) { continue; } JsonNode * lnode = json_object_get_member(node, member); + GValue * value = node2value(lnode); - if (JSON_NODE_TYPE(lnode) != JSON_NODE_VALUE) { - GValue * value = handle_complex_types(lnode); - if (value != NULL) { - dbusmenu_menuitem_property_set_value(mi, member, value); - g_value_unset(value); - g_free(value); - } - } else { - GValue value = {0}; - json_node_get_value(lnode, &value); - dbusmenu_menuitem_property_set_value(mi, member, &value); - g_value_unset(&value); + if (value != NULL) { + dbusmenu_menuitem_property_set_value(mi, member, value); + g_value_unset(value); + g_free(value); } } -- cgit v1.2.3 From ced63228a6304953dcd57adcc6a1f9906b2d9a21 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 28 Jun 2010 16:54:33 -0500 Subject: Turn objects into hashmaps --- tests/json-loader.c | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) (limited to 'tests/json-loader.c') diff --git a/tests/json-loader.c b/tests/json-loader.c index aa11aa5..e61a49a 100644 --- a/tests/json-loader.c +++ b/tests/json-loader.c @@ -1,5 +1,6 @@ #include "json-loader.h" +#include static GValue * node2value (JsonNode * node) @@ -17,9 +18,39 @@ node2value (JsonNode * node) if (JSON_NODE_TYPE(node) == JSON_NODE_ARRAY) { } - if (JSON_NODE_TYPE(node) == JSON_NODE_OBJECT) { + JsonObject * obj = json_node_get_object(node); + + GType type = dbus_g_type_get_map("GHashTable", G_TYPE_STRING, G_TYPE_VALUE); + GHashTable * hash = (GHashTable *)dbus_g_type_specialized_construct(type); + + g_value_init(value, type); + g_value_take_boxed(value, hash); + + DBusGTypeSpecializedAppendContext ctx; + dbus_g_type_specialized_init_append(value, &ctx); + + GList * members = NULL; + for (members = json_object_get_members(obj); members != NULL; members = g_list_next(members)) { + const gchar * member = members->data; + + JsonNode * lnode = json_object_get_member(obj, member); + GValue * value = node2value(lnode); + + if (value != NULL) { + GValue name = {0}; + g_value_init(&name, G_TYPE_STRING); + g_value_set_static_string(&name, member); + + dbus_g_type_specialized_map_append(&ctx, &name, value); + + g_value_unset(&name); + g_value_unset(value); + g_free(value); + } + } + } g_free(value); -- cgit v1.2.3 From ccd36f867b28766e708ab7bdbbd36fda3492a8fd Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 28 Jun 2010 17:13:32 -0500 Subject: Okay, so now we're handling the complex areas. --- tests/json-loader.c | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) (limited to 'tests/json-loader.c') diff --git a/tests/json-loader.c b/tests/json-loader.c index e61a49a..64e1579 100644 --- a/tests/json-loader.c +++ b/tests/json-loader.c @@ -17,6 +17,31 @@ node2value (JsonNode * node) } if (JSON_NODE_TYPE(node) == JSON_NODE_ARRAY) { + JsonArray * array = json_node_get_array(node); + JsonNode * first = json_array_get_element(array, 0); + + if (JSON_NODE_TYPE(first) == JSON_NODE_VALUE) { + + } else { + GValue * subvalue = node2value(first); + GType type = dbus_g_type_get_collection("GPtrArray", G_VALUE_TYPE(subvalue)); + gpointer * wrapper = dbus_g_type_specialized_construct(type); + + g_value_init(value, type); + g_value_take_boxed(value, wrapper); + + DBusGTypeSpecializedAppendContext ctx; + dbus_g_type_specialized_init_append(value, &ctx); + + dbus_g_type_specialized_collection_append(&ctx, subvalue); + int i; + for (i = 1; i < json_array_get_length(array); i++) { + GValue * subvalue = node2value(node); + dbus_g_type_specialized_collection_append(&ctx, subvalue); + } + + dbus_g_type_specialized_collection_end_append(&ctx); + } } if (JSON_NODE_TYPE(node) == JSON_NODE_OBJECT) { @@ -50,11 +75,9 @@ node2value (JsonNode * node) g_free(value); } } - } - g_free(value); - return NULL; + return value; } static void -- cgit v1.2.3 From 3bbd2b821624a706b94a297e7e46442b9ae227f9 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 28 Jun 2010 17:24:09 -0500 Subject: Okay, now we've got some basic code for dealing with value arrays --- tests/json-loader.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'tests/json-loader.c') diff --git a/tests/json-loader.c b/tests/json-loader.c index 64e1579..2f27bff 100644 --- a/tests/json-loader.c +++ b/tests/json-loader.c @@ -21,6 +21,37 @@ node2value (JsonNode * node) JsonNode * first = json_array_get_element(array, 0); if (JSON_NODE_TYPE(first) == JSON_NODE_VALUE) { + GValue subvalue = {0}; + json_node_get_value(first, &subvalue); + + if (G_VALUE_TYPE(&subvalue) == G_TYPE_STRING) { + GArray * garray = g_array_sized_new(TRUE, TRUE, sizeof(gchar *), json_array_get_length(array)); + g_value_init(value, G_TYPE_STRV); + g_value_take_boxed(value, garray->data); + + int i; + for (i = 0; i < json_array_get_length(array); i++) { + const gchar * str = json_node_get_string(first); + gchar * dupstr = g_strdup(str); + g_array_append_val(garray, dupstr); + } + + g_array_free(garray, FALSE); + } else { + GValueArray * varray = g_value_array_new(json_array_get_length(array)); + g_value_init(value, G_TYPE_VALUE_ARRAY); + g_value_take_boxed(value, varray); + + g_value_array_append(varray, &subvalue); + g_value_unset(&subvalue); + + int i; + for (i = 1; i < json_array_get_length(array); i++) { + json_node_get_value(first, &subvalue); + g_value_array_append(varray, &subvalue); + g_value_unset(&subvalue); + } + } } else { GValue * subvalue = node2value(first); -- cgit v1.2.3 From 65cfbcd1339473de0540ef9037af336ce893d008 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 28 Jun 2010 22:12:07 -0500 Subject: Look at all the values instead of just the first. --- tests/json-loader.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/json-loader.c') diff --git a/tests/json-loader.c b/tests/json-loader.c index 2f27bff..97f1c13 100644 --- a/tests/json-loader.c +++ b/tests/json-loader.c @@ -31,7 +31,7 @@ node2value (JsonNode * node) int i; for (i = 0; i < json_array_get_length(array); i++) { - const gchar * str = json_node_get_string(first); + const gchar * str = json_node_get_string(json_array_get_element(array, i)); gchar * dupstr = g_strdup(str); g_array_append_val(garray, dupstr); } -- cgit v1.2.3 From 511e68461114325f3685bc547517668b179b4914 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 28 Jun 2010 22:39:59 -0500 Subject: Forgot copyright headers --- tests/json-loader.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'tests/json-loader.c') diff --git a/tests/json-loader.c b/tests/json-loader.c index 97f1c13..aad4295 100644 --- a/tests/json-loader.c +++ b/tests/json-loader.c @@ -1,3 +1,23 @@ +/* +A loader to turn JSON into dbusmenu menuitems + +Copyright 2010 Canonical Ltd. + +Authors: + Ted Gould + +This program is free software: you can redistribute it and/or modify it +under the terms of the GNU General Public License version 3, as published +by the Free Software Foundation. + +This program is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranties of +MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR +PURPOSE. See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along +with this program. If not, see . +*/ #include "json-loader.h" #include -- cgit v1.2.3 From a8fc233f37e08f52ed7ca80fbd284277ca1bd33e Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 16 Nov 2010 11:23:46 -0600 Subject: Taking out the dbus-glib specialized types for now --- tests/json-loader.c | 51 ++------------------------------------------------- 1 file changed, 2 insertions(+), 49 deletions(-) (limited to 'tests/json-loader.c') diff --git a/tests/json-loader.c b/tests/json-loader.c index aad4295..9e67666 100644 --- a/tests/json-loader.c +++ b/tests/json-loader.c @@ -20,7 +20,6 @@ with this program. If not, see . */ #include "json-loader.h" -#include static GValue * node2value (JsonNode * node) @@ -74,58 +73,12 @@ node2value (JsonNode * node) } } else { - GValue * subvalue = node2value(first); - GType type = dbus_g_type_get_collection("GPtrArray", G_VALUE_TYPE(subvalue)); - gpointer * wrapper = dbus_g_type_specialized_construct(type); - - g_value_init(value, type); - g_value_take_boxed(value, wrapper); - - DBusGTypeSpecializedAppendContext ctx; - dbus_g_type_specialized_init_append(value, &ctx); - - dbus_g_type_specialized_collection_append(&ctx, subvalue); - int i; - for (i = 1; i < json_array_get_length(array); i++) { - GValue * subvalue = node2value(node); - dbus_g_type_specialized_collection_append(&ctx, subvalue); - } - - dbus_g_type_specialized_collection_end_append(&ctx); + g_warning("Complex array not supported"); } } if (JSON_NODE_TYPE(node) == JSON_NODE_OBJECT) { - JsonObject * obj = json_node_get_object(node); - - GType type = dbus_g_type_get_map("GHashTable", G_TYPE_STRING, G_TYPE_VALUE); - GHashTable * hash = (GHashTable *)dbus_g_type_specialized_construct(type); - - g_value_init(value, type); - g_value_take_boxed(value, hash); - - DBusGTypeSpecializedAppendContext ctx; - dbus_g_type_specialized_init_append(value, &ctx); - - GList * members = NULL; - for (members = json_object_get_members(obj); members != NULL; members = g_list_next(members)) { - const gchar * member = members->data; - - JsonNode * lnode = json_object_get_member(obj, member); - GValue * value = node2value(lnode); - - if (value != NULL) { - GValue name = {0}; - g_value_init(&name, G_TYPE_STRING); - g_value_set_static_string(&name, member); - - dbus_g_type_specialized_map_append(&ctx, &name, value); - - g_value_unset(&name); - g_value_unset(value); - g_free(value); - } - } + g_warning("Object nodes are a problem"); } return value; -- cgit v1.2.3 From 784522930b3102d044000ef1dd6af1854548e3be Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 23 Nov 2010 14:40:11 -0600 Subject: Convert json loader to using variants --- tests/json-loader.c | 107 ++++++++++++++++++++++++++++------------------------ 1 file changed, 57 insertions(+), 50 deletions(-) (limited to 'tests/json-loader.c') diff --git a/tests/json-loader.c b/tests/json-loader.c index 9e67666..4d3e6aa 100644 --- a/tests/json-loader.c +++ b/tests/json-loader.c @@ -21,67 +21,75 @@ with this program. If not, see . #include "json-loader.h" -static GValue * -node2value (JsonNode * node) +static GVariant * node2variant (JsonNode * node); + +static void +array_foreach (JsonArray * array, guint index, JsonNode * node, gpointer user_data) +{ + GVariantBuilder * builder = (GVariantBuilder *)user_data; + GVariant * variant = node2variant(node); + if (variant != NULL) { + g_variant_builder_add_value(builder, variant); + } + return; +} + +static void +object_foreach (JsonObject * array, const gchar * member, JsonNode * node, gpointer user_data) +{ + GVariantBuilder * builder = (GVariantBuilder *)user_data; + GVariant * variant = node2variant(node); + if (variant != NULL) { + g_variant_builder_add(builder, "{sv}", member, variant); + } + return; +} + +static GVariant * +node2variant (JsonNode * node) { if (node == NULL) { return NULL; } - GValue * value = g_new0(GValue, 1); - if (JSON_NODE_TYPE(node) == JSON_NODE_VALUE) { - json_node_get_value(node, value); - return value; + switch (json_node_get_value_type(node)) { + case G_TYPE_INT: + case G_TYPE_INT64: + return g_variant_new_int64(json_node_get_int(node)); + case G_TYPE_DOUBLE: + case G_TYPE_FLOAT: + return g_variant_new_double(json_node_get_double(node)); + case G_TYPE_BOOLEAN: + return g_variant_new_boolean(json_node_get_boolean(node)); + case G_TYPE_STRING: + return g_variant_new_string(json_node_get_string(node)); + default: + g_assert_not_reached(); + } } if (JSON_NODE_TYPE(node) == JSON_NODE_ARRAY) { + GVariantBuilder builder; + g_variant_builder_init(&builder, G_VARIANT_TYPE_ARRAY); + JsonArray * array = json_node_get_array(node); - JsonNode * first = json_array_get_element(array, 0); - - if (JSON_NODE_TYPE(first) == JSON_NODE_VALUE) { - GValue subvalue = {0}; - json_node_get_value(first, &subvalue); - - if (G_VALUE_TYPE(&subvalue) == G_TYPE_STRING) { - GArray * garray = g_array_sized_new(TRUE, TRUE, sizeof(gchar *), json_array_get_length(array)); - g_value_init(value, G_TYPE_STRV); - g_value_take_boxed(value, garray->data); - - int i; - for (i = 0; i < json_array_get_length(array); i++) { - const gchar * str = json_node_get_string(json_array_get_element(array, i)); - gchar * dupstr = g_strdup(str); - g_array_append_val(garray, dupstr); - } - - g_array_free(garray, FALSE); - } else { - GValueArray * varray = g_value_array_new(json_array_get_length(array)); - g_value_init(value, G_TYPE_VALUE_ARRAY); - g_value_take_boxed(value, varray); - - g_value_array_append(varray, &subvalue); - g_value_unset(&subvalue); - - int i; - for (i = 1; i < json_array_get_length(array); i++) { - json_node_get_value(first, &subvalue); - g_value_array_append(varray, &subvalue); - g_value_unset(&subvalue); - } - } + json_array_foreach_element(array, array_foreach, &builder); - } else { - g_warning("Complex array not supported"); - } + return g_variant_builder_end(&builder); } if (JSON_NODE_TYPE(node) == JSON_NODE_OBJECT) { - g_warning("Object nodes are a problem"); + GVariantBuilder builder; + g_variant_builder_init(&builder, G_VARIANT_TYPE_DICTIONARY); + + JsonObject * array = json_node_get_object(node); + json_object_foreach_member(array, object_foreach, &builder); + + return g_variant_builder_end(&builder); } - return value; + return NULL; } static void @@ -97,12 +105,11 @@ set_props (DbusmenuMenuitem * mi, JsonObject * node) if (!g_strcmp0(member, "submenu")) { continue; } JsonNode * lnode = json_object_get_member(node, member); - GValue * value = node2value(lnode); + GVariant * variant = node2variant(lnode); - if (value != NULL) { - dbusmenu_menuitem_property_set_value(mi, member, value); - g_value_unset(value); - g_free(value); + if (variant != NULL) { + dbusmenu_menuitem_property_set_variant(mi, member, variant); + g_variant_unref(variant); } } -- cgit v1.2.3 From 4bf64d184cb6eb7ac89d91705e947aedd2aa981a Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 1 Dec 2010 21:35:46 -0600 Subject: Making the ints from the JSON file int32s --- tests/json-loader.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/json-loader.c') diff --git a/tests/json-loader.c b/tests/json-loader.c index 4d3e6aa..14e90e0 100644 --- a/tests/json-loader.c +++ b/tests/json-loader.c @@ -56,7 +56,7 @@ node2variant (JsonNode * node) switch (json_node_get_value_type(node)) { case G_TYPE_INT: case G_TYPE_INT64: - return g_variant_new_int64(json_node_get_int(node)); + return g_variant_new_int32(json_node_get_int(node)); case G_TYPE_DOUBLE: case G_TYPE_FLOAT: return g_variant_new_double(json_node_get_double(node)); -- cgit v1.2.3 From e1094452eda0314065bb1b02d616d573c0367a74 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 15 Feb 2011 11:50:54 -0600 Subject: Don't unref the variant as we don't really have a ref to it, it's still floating --- tests/json-loader.c | 1 - 1 file changed, 1 deletion(-) (limited to 'tests/json-loader.c') diff --git a/tests/json-loader.c b/tests/json-loader.c index 14e90e0..36157dc 100644 --- a/tests/json-loader.c +++ b/tests/json-loader.c @@ -109,7 +109,6 @@ set_props (DbusmenuMenuitem * mi, JsonObject * node) if (variant != NULL) { dbusmenu_menuitem_property_set_variant(mi, member, variant); - g_variant_unref(variant); } } -- cgit v1.2.3