aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/libdbusmenu-glib/reference/libdbusmenu-glib-sections.txt3
-rw-r--r--tests/Makefile.am2
-rw-r--r--tests/json-loader.c23
-rw-r--r--tests/test-glib-proxy-client.c1
4 files changed, 20 insertions, 9 deletions
diff --git a/docs/libdbusmenu-glib/reference/libdbusmenu-glib-sections.txt b/docs/libdbusmenu-glib/reference/libdbusmenu-glib-sections.txt
index d95ec4c..7f11278 100644
--- a/docs/libdbusmenu-glib/reference/libdbusmenu-glib-sections.txt
+++ b/docs/libdbusmenu-glib/reference/libdbusmenu-glib-sections.txt
@@ -60,6 +60,7 @@ DBUSMENU_MENUITEM_PROP_TOGGLE_STATE
DBUSMENU_MENUITEM_PROP_CHILD_DISPLAY
DBUSMENU_MENUITEM_PROP_SHORTCUT
DBUSMENU_MENUITEM_PROP_DISPOSITION
+DBUSMENU_MENUITEM_PROP_ACCESSIBLE_DESC
DBUSMENU_MENUITEM_TOGGLE_CHECK
DBUSMENU_MENUITEM_TOGGLE_RADIO
DBUSMENU_MENUITEM_TOGGLE_STATE_UNCHECKED
@@ -98,10 +99,12 @@ dbusmenu_menuitem_child_find
dbusmenu_menuitem_find_id
dbusmenu_menuitem_property_set
dbusmenu_menuitem_property_set_bool
+dbusmenu_menuitem_property_set_byte_array
dbusmenu_menuitem_property_set_int
dbusmenu_menuitem_property_set_variant
dbusmenu_menuitem_property_get
dbusmenu_menuitem_property_get_bool
+dbusmenu_menuitem_property_get_byte_array
dbusmenu_menuitem_property_get_int
dbusmenu_menuitem_property_get_variant
dbusmenu_menuitem_property_exist
diff --git a/tests/Makefile.am b/tests/Makefile.am
index a227916..532c14f 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -1,5 +1,5 @@
-DBUS_RUNNER=dbus-test-runner
+DBUS_RUNNER=dbus-test-runner --max-wait=0
CLEANFILES=
DISTCLEANFILES=
diff --git a/tests/json-loader.c b/tests/json-loader.c
index 36157dc..7f0ec8e 100644
--- a/tests/json-loader.c
+++ b/tests/json-loader.c
@@ -21,13 +21,13 @@ with this program. If not, see <http://www.gnu.org/licenses/>.
#include "json-loader.h"
-static GVariant * node2variant (JsonNode * node);
+static GVariant * node2variant (JsonNode * node, const gchar * name);
static void
array_foreach (JsonArray * array, guint index, JsonNode * node, gpointer user_data)
{
GVariantBuilder * builder = (GVariantBuilder *)user_data;
- GVariant * variant = node2variant(node);
+ GVariant * variant = node2variant(node, NULL);
if (variant != NULL) {
g_variant_builder_add_value(builder, variant);
}
@@ -38,7 +38,7 @@ static void
object_foreach (JsonObject * array, const gchar * member, JsonNode * node, gpointer user_data)
{
GVariantBuilder * builder = (GVariantBuilder *)user_data;
- GVariant * variant = node2variant(node);
+ GVariant * variant = node2variant(node, member);
if (variant != NULL) {
g_variant_builder_add(builder, "{sv}", member, variant);
}
@@ -46,7 +46,7 @@ object_foreach (JsonObject * array, const gchar * member, JsonNode * node, gpoin
}
static GVariant *
-node2variant (JsonNode * node)
+node2variant (JsonNode * node, const gchar * name)
{
if (node == NULL) {
return NULL;
@@ -62,8 +62,17 @@ node2variant (JsonNode * node)
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));
+ case G_TYPE_STRING: {
+ if (g_strcmp0(name, DBUSMENU_MENUITEM_PROP_ICON_DATA) != 0) {
+ return g_variant_new_string(json_node_get_string(node));
+ } else {
+ gsize length;
+ guchar * b64 = g_base64_decode(json_node_get_string(node), &length);
+ GVariant * retval = g_variant_new_fixed_array(G_VARIANT_TYPE_BYTE, b64, length, sizeof(guchar));
+ g_free(b64);
+ return retval;
+ }
+ }
default:
g_assert_not_reached();
}
@@ -105,7 +114,7 @@ set_props (DbusmenuMenuitem * mi, JsonObject * node)
if (!g_strcmp0(member, "submenu")) { continue; }
JsonNode * lnode = json_object_get_member(node, member);
- GVariant * variant = node2variant(lnode);
+ GVariant * variant = node2variant(lnode, member);
if (variant != NULL) {
dbusmenu_menuitem_property_set_variant(mi, member, variant);
diff --git a/tests/test-glib-proxy-client.c b/tests/test-glib-proxy-client.c
index 2e1e2d2..d20c27c 100644
--- a/tests/test-glib-proxy-client.c
+++ b/tests/test-glib-proxy-client.c
@@ -152,7 +152,6 @@ layout_verify_timer (gpointer data)
GVariant * value = g_variant_new("i", 0);
dbusmenu_menuitem_handle_event(menuroot, "clicked", value, layouton);
- g_variant_unref(value);
return FALSE;
}