returning properties

Mike Gorse mgorse at suse.com
Fri Oct 21 11:24:00 PDT 2011


Hi Simon,

On Fri, 21 Oct 2011, Simon McVittie wrote:

>> I just noticed that some code I wrote using gdbus is returning a
>> property as a struct inside a variant, even when there is only one
>> piece of data being returned.
>
> Method calls in GDBus always return a GVariant struct (you can call it a
> tuple if you prefer) containing the actual returns from the method, to make
> the calling convention consistent when you call a method with 0, 1 or 2+
> returns:

Actually, I just figured out what my problem was--my Get handler is 
calling g_variant_new with "(b)" for the type, where changing "(b)" to "b" 
gives me the behavior I'd expect / seems correct. So gdbus was doing what 
I was telling it to do, in any case.

Thanks,
-Mike G-


More information about the dbus mailing list