Bug 55107

Summary: GVariant-based Handler_Info
Product: Telepathy Reporter: Simon McVittie <smcv>
Component: tp-glibAssignee: Telepathy bugs list <telepathy-bugs>
Status: RESOLVED FIXED QA Contact: Telepathy bugs list <telepathy-bugs>
Severity: enhancement    
Priority: low Keywords: patch
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Bug Depends on:    
Bug Blocks: 30422    
Attachments: handle-channel-context: replace get_handler_info by a GVariant version
test tp_handle_channel_context_dup_handler_info()
handle-channel-context: store handler_info as a GVariant

Description Simon McVittie 2012-09-19 15:21:42 UTC
+++ This bug was initially created as a clone of Bug #30422 +++

tp_handle_channels_context_get_handler_info returns a dbus-glib GHashTable. We should have a version that returns a new ref to a G_VARIANT_TYPE_VARDICT.
Comment 1 Guillaume Desmottes 2014-02-28 12:34:11 UTC
Created attachment 94880 [details] [review]
handle-channel-context: replace get_handler_info by a GVariant version
Comment 2 Guillaume Desmottes 2014-02-28 12:34:25 UTC
Created attachment 94881 [details] [review]
test tp_handle_channel_context_dup_handler_info()
Comment 3 Guillaume Desmottes 2014-02-28 12:34:44 UTC
Created attachment 94882 [details] [review]
handle-channel-context: store handler_info as a GVariant
Comment 4 Simon McVittie 2014-02-28 13:05:54 UTC
Comment on attachment 94880 [details] [review]
handle-channel-context: replace get_handler_info by a GVariant version

Review of attachment 94880 [details] [review]:
-----------------------------------------------------------------

::: telepathy-glib/handle-channel-context.c
@@ +690,3 @@
>  {
>    g_return_val_if_fail (TP_IS_HANDLE_CHANNELS_CONTEXT (self), NULL);
> +  return tp_asv_to_vardict (self->handler_info);

Contrary to Bug #55109, this relies for its correctness on tp_asv_to_vardict *not* returning a floating ref. Pick one :-)
Comment 5 Simon McVittie 2014-02-28 13:06:40 UTC
Comment on attachment 94881 [details] [review]
test tp_handle_channel_context_dup_handler_info()

Review of attachment 94881 [details] [review]:
-----------------------------------------------------------------

++
Comment 6 Guillaume Desmottes 2014-02-28 14:27:42 UTC
(In reply to comment #4)
> Comment on attachment 94880 [details] [review] [review]
> handle-channel-context: replace get_handler_info by a GVariant version
> 
> Review of attachment 94880 [details] [review] [review]:
> -----------------------------------------------------------------
> 
> ::: telepathy-glib/handle-channel-context.c
> @@ +690,3 @@
> >  {
> >    g_return_val_if_fail (TP_IS_HANDLE_CHANNELS_CONTEXT (self), NULL);
> > +  return tp_asv_to_vardict (self->handler_info);
> 
> Contrary to Bug #55109, this relies for its correctness on tp_asv_to_vardict
> *not* returning a floating ref. Pick one :-)

I rebased the branch on top of next where tp_asv_to_vardict() now returns a floating ref so it's now ok.
Comment 7 Simon McVittie 2014-02-28 16:03:07 UTC
(In reply to comment #6)
> > Contrary to Bug #55109, this relies for its correctness on tp_asv_to_vardict
> > *not* returning a floating ref. Pick one :-)
> 
> I rebased the branch on top of next where tp_asv_to_vardict() now returns a
> floating ref so it's now ok.

If this is now g_variant_ref_sink (tp_asv_to_vardict (self->handler_info)), ship it. Otherwise, no.
Comment 8 Guillaume Desmottes 2014-03-03 10:03:45 UTC
(In reply to comment #7)
> (In reply to comment #6)
> > > Contrary to Bug #55109, this relies for its correctness on tp_asv_to_vardict
> > > *not* returning a floating ref. Pick one :-)
> > 
> > I rebased the branch on top of next where tp_asv_to_vardict() now returns a
> > floating ref so it's now ok.
> 
> If this is now g_variant_ref_sink (tp_asv_to_vardict (self->handler_info)),
> ship it. Otherwise, no.

It is; merged.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.