From 6fbda2b161a3e0ee428d87c73e1fa6656f635d92 Mon Sep 17 00:00:00 2001 From: Sjoerd Simons Date: Sun, 1 Jul 2012 12:28:20 +0200 Subject: applet: Fix device_get_name() in the applet g_dbus_proxy_call_sync returns a tuple with the results, not the results directly. As such we first need to get the dictionary out of the tuple before we can lookup the information in it. https://bugzilla.gnome.org/show_bug.cgi?id=674414 --- applet/bluetooth-applet.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/applet/bluetooth-applet.c b/applet/bluetooth-applet.c index 0eb29734..32d373e5 100644 --- a/applet/bluetooth-applet.c +++ b/applet/bluetooth-applet.c @@ -313,6 +313,7 @@ device_get_name (GDBusProxy *proxy, char **long_name) { GVariant *value; GVariant *result; + GVariant *dict; char *alias, *address; g_return_val_if_fail (long_name != NULL, NULL); @@ -322,14 +323,17 @@ device_get_name (GDBusProxy *proxy, char **long_name) if (result == NULL) return NULL; - value = g_variant_lookup_value (result, "Address", G_VARIANT_TYPE_STRING); + /* Retrieve the dictionary */ + dict = g_variant_get_child_value (result, 0); + + value = g_variant_lookup_value (dict, "Address", G_VARIANT_TYPE_STRING); if (value == NULL) { g_variant_unref (result); return NULL; } address = g_strdup (g_variant_get_string (value, NULL)); - value = g_variant_lookup_value (result, "Name", G_VARIANT_TYPE_STRING); + value = g_variant_lookup_value (dict, "Name", G_VARIANT_TYPE_STRING); alias = value ? g_strdup (g_variant_get_string (value, NULL)) : g_strdup (address); g_variant_unref (result); -- cgit v1.2.1