diff options
author | Ted Gould <ted@gould.cx> | 2010-06-28 16:04:48 -0500 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2010-06-28 16:04:48 -0500 |
commit | fa34ff87fd2149d3c89c8b00fa8713b8a2b9b563 (patch) | |
tree | 2f71467ca436ff70eda3fc260139bc6a809d46b1 | |
parent | 71e4cc90f10559cc675d696c773ed2825a2cbb8d (diff) | |
download | libdbusmenu-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.c | 25 |
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; |