[Bug 31583] Expose TpProxyFeature in the API

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Tue Apr 26 09:52:29 CEST 2011


https://bugs.freedesktop.org/show_bug.cgi?id=31583

--- Comment #19 from Guillaume Desmottes <guillaume.desmottes at collabora.co.uk> 2011-04-26 00:52:28 PDT ---
I rebased the branch on top of master to make sure it still applies nicely (it
does) and didn't break tests (it doesn't!).
The last commit your viewed was:

commit b55ba11e86d458df41fcf56f214b9675dbe37416
Author: Guillaume Desmottes <guillaume.desmottes at collabora.co.uk>
Date:   Thu Jan 27 14:49:03 2011 +0100

    use tp_tests_init() in most tests

(In reply to comment #17)
> > > a5adfbb:
> > > 
> > > @@ -649,7 +676,8 @@ get_pending_messages_cb (TpProxy *proxy,
> > >      gpointer user_data,
> > >      GObject *weak_object)
> > >  {
> > > -  TpTextChannel *self = user_data;
> > > +  TpTextChannel *self = (TpTextChannel *) weak_object;
> > > 
> > > We may as well use a checked cast if we're casting at all. But...
> > 
> > Those are more time consuming, so I try to limit them.
> 
> Avoiding repeated checked casts in the same function is fine: if you've already
> checked the cast to TpTextChannel, then casting to GObject is fine. But a
> callback's user_data seems like a perfect place to use a checked cast.
> 
> If you insist on not using TP_TEXT_CHANNEL(), then don't use any explicit cast
> at all, since user_data is a gpointer. (Is 'self' the same pointer as 'proxy'
> here?)

Yeah it is. I changed to now cast from proxy instead of the weak_object as
that's a probably bit clearer.

> > > +typedef struct
> > > +{
> > > +  GList *parts_list;
> > > +  GSimpleAsyncResult *result;
> > > +} IdentifyMessagesCtx;
> > > +
> > > 
> > > If you use the GSimpleAsyncResult object as the weak_object, you don't need to
> > > faff with context structs, since you can fish the TpTextChannel out of it using
> > > g_simple_async_result_get_source_object.
> > > 
> > > (Since the GSimpleAsyncResult refs the channel anyway, this doesn't change the
> > > weak_object-y behaviour at all.)
> > 
> > Oh, good idea. done.
> 
> You could use free_parts_list as the destroy callback for
> tp_connection_get_contacts_by_id() and tp_connection_get_contacts_by_handle().

Good idea; done.

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- 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