[Telepathy] dbus-glib GValue to GVariant

Danielle Madeley danielle.madeley at collabora.co.uk
Mon Jun 21 20:22:14 PDT 2010


One of the problems we have with applying GObject-Introspection to
telepathy-glib is that we have no way to introspect the a{sv}
GHashTables exposed in tp-glib's API if the variant value is more
complex than a simple type, since the GValue used to store the variant
does not contain the full type.

i.e. introspection works for { 'one': <1> }, but not { 'one': <(1,
'One')> }

dbus-glib however stores complete type information for registered
container types, which we can look up to build a GVariant of the complex
type.

I've written a proof of concept of this: g_value_to_g_variant (attached)

I figure this sort of thing can be provided as a utility function that
we can then use in tp-glib to make binding-friendly API. It also may
well ease the transition from dbus-glib to gdbus for some people.
Possibly it should be provided by dbus-glib? Thoughts?

-- 
Danielle Madeley
Software Developer, Collabora Ltd.                  Melbourne, Australia

www.collabora.co.uk
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gvalue-to-gvariant.c
Type: text/x-csrc
Size: 6439 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/dbus/attachments/20100622/c8e88a3b/attachment.c>
-------------- next part --------------
_______________________________________________
telepathy mailing list
telepathy at lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/telepathy


More information about the dbus mailing list