aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-06-28 16:04:48 -0500
committerTed Gould <ted@gould.cx>2010-06-28 16:04:48 -0500
commitfa34ff87fd2149d3c89c8b00fa8713b8a2b9b563 (patch)
tree2f71467ca436ff70eda3fc260139bc6a809d46b1
parent71e4cc90f10559cc675d696c773ed2825a2cbb8d (diff)
downloadlibdbusmenu-fa34ff87fd2149d3c89c8b00fa8713b8a2b9b563.tar.gz
libdbusmenu-fa34ff87fd2149d3c89c8b00fa8713b8a2b9b563.tar.bz2
libdbusmenu-fa34ff87fd2149d3c89c8b00fa8713b8a2b9b563.zip
Make the code behave exactly the same but with a function call in the middle.
-rw-r--r--tests/json-loader.c25
1 files changed, 20 insertions, 5 deletions
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;