GNOME Bugzilla – Bug 744595
Dbus disable automatic variant unboxing
Last modified: 2017-01-06 07:44:17 UTC
I have dbus interface like this: [DBus (name = "org.kde.StatusNotifierItem")] public interface SNItemIface : Object { /*More properties */ /* Tooltip */ [DBus(signature = "sa(iiay)ss")] public abstract Variant tool_tip {owned get;} /* More properties } When generating C code, I see this: static GVariant* sn_item_iface_dbus_proxy_get_tool_tip (SNItemIface* self) { GVariant *_inner_reply; GVariant* _result; _inner_reply = g_dbus_proxy_get_cached_property ((GDBusProxy *) self, "ToolTip"); if (!_inner_reply) { GVariant *_arguments; GVariant *_reply; GVariantBuilder _arguments_builder; g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE); g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("org.kde.StatusNotifierItem")); g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("ToolTip")); _arguments = g_variant_builder_end (&_arguments_builder); _reply = g_dbus_proxy_call_sync ((GDBusProxy *) self, "org.freedesktop.DBus.Properties.Get", _arguments, G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL); if (!_reply) { return NULL; } g_variant_get (_reply, "(v)", &_inner_reply); g_variant_unref (_reply); _result = g_variant_get_variant (_inner_reply); g_variant_unref (_inner_reply); return _result; } But Vala must not use g_variant_get_variant to this properties, because it is not of "v" type.
Created attachment 342504 [details] [review] D-Bus: support [DBus (signature = ...)] for properties This was working for methods and signals, but not for properties. Also add tests for all cases.
Attachment 342504 [details] pushed as 415b300 - D-Bus: support [DBus (signature = ...)] for properties