[Bug 75204] [next] remove TpAsv from public API
bugzilla-daemon at freedesktop.org
bugzilla-daemon at freedesktop.org
Mon Feb 24 08:16:02 PST 2014
https://bugs.freedesktop.org/show_bug.cgi?id=75204
Xavier Claessens <xclaesse at gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |xclaesse at gmail.com
--- Comment #15 from Xavier Claessens <xclaesse at gmail.com> ---
(In reply to comment #9)
> >>> from gi.repository import GLib
> >>> asv = GLib.Variant.parse(GLib.VariantType.new('a{sv}'), '@a{sv} { "hello": <"world">, "nested": <<42>> }', None, None)
> >>> print asv.lookup_value('hello', GLib.VariantType.new('v'))
> None
> >>> print asv.lookup_value('nested', GLib.VariantType.new('v'))
> <42>
>
> So I think you're going to have to use GVariantDict, or iteration.
GVariantDict won't change anything.
>>> asv.lookup_value('hello')
GLib.Variant('s', 'world')
>>> asv.lookup_value('hello', GLib.VariantType.new('s'))
GLib.Variant('s', 'world')
Also tp_account_dup_parameters_vardict()'s doc explicitly says to use
g_variant_lookup() or g_variant_lookup_value(). So the doc would have to be
fixed if Simon is correct.
http://cgit.collabora.com/git/user/cassidy/telepathy-mission-control/commit/?h=next-vardict&id=c9572997a31ed66c4a1236d09ac0f80369d2c494
It leaks because g_variant_dict_clear() is missing. It also uselessly create a
GVariantDict where a simple g_variant_lookup_value(parameters, NULL) does the
exact same job.
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
More information about the telepathy-bugs
mailing list