Re: [Vala] How to use a DBus Dict in Vala?



Am Tuesday 11 November 2008 11:52:01 schrieb Daniele Benucci:
2008/11/10 Daniele Benucci <d benux gmail com>

I need to call a DBus method that returns a "Dict of {String, Variant}".
How can I store and handle this result in Vala?

I found it.
HashTable to store the dict and GValue to store the variant.
It works only with Vala >= 0.5.1 since these two types are supported in
DBus clients starting with that version.

Does that also work for signals? I want to catch a signal with the signature 
a{sv}, but when I define something like:

public void testing_test( dynamic DBus.Object sender, HashTable<string,Value?> 
dict, Value? foo )

my signal handler does not get called.

(yes it works for simple types such as 's', and yes, I'm sure the signature is 
correct as mdbus shows the signal emission at run time like that:

 [SIGNAL]    org.freesmartphone.Testing.Test   
from :1.275 /org/freesmartphone/Testing
(dbus.Dictionary({dbus.String(u'yo'): dbus.String(u'kurt', variant_level=1)}, 
signature=dbus.Signature('sv')),)

-- 
:M:



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]