[Telepathy] dbus-glib GValue to GVariant

Christian Dywan christian at lanedo.com
Thu Jun 24 03:42:19 PDT 2010


Am Thu, 24 Jun 2010 11:17:00 +0100
schrieb Will Thompson <will.thompson at collabora.co.uk>:

> On 22/06/10 04:16, Danielle Madeley wrote:
> > I've written a proof of concept of this: g_value_to_g_variant
> > (attached)
> 
> Looks nice to me. I think it leaks when it recurses, though: you free 
> the GPtrArray of children, but don't unref the GVariants. Probably
> just a matter of g_ptr_array_new_with_free_func ((GDestroyNotify) 
> g_variant_unref);.
> 
> > 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?
> 
> I guess the only reason for it not to live in dbus-glib would be not 
> wanting it to depend on modernish glib. But otherwise I don't see why 
> dbus-gtype-specialized.h shouldn't grow this as 
> dbus_g_value_build_g_variant () or similar. I could see it being
> useful in more libraries than just tp-glib.

There is GLIB_CHECK_VERSION for that situation.

-- 
ciao,
    Christian


More information about the dbus mailing list