[Bug 38142] proxy factories
bugzilla-daemon at freedesktop.org
bugzilla-daemon at freedesktop.org
Tue Jul 26 11:29:47 CEST 2011
https://bugs.freedesktop.org/show_bug.cgi?id=38142
--- Comment #66 from Xavier Claessens <xclaesse at gmail.com> 2011-07-26 02:29:46 PDT ---
(In reply to comment #64)
> - channel = tp_client_channel_factory_create_channel (
> - self->priv->channel_factory, connection, chan_path, chan_props,
> - &error);
> + if (self->priv->channel_factory != NULL)
> + channel = tp_client_channel_factory_create_channel (
> + self->priv->channel_factory, connection, chan_path, chan_props,
> + &error);
> + else
> + channel = tp_simple_client_factory_ensure_channel (
> + tp_proxy_get_factory (self->priv->account_mgr), connection,
> + chan_path, chan_props, &error);
>
> This, and the equivalent for dupping features, is repeatedly duplicated.
Right, I could factor-out a function for that. I'll prepare a patch.
> Is tp_proxy_get_factory() guaranteed to return non-NULL if
> self->priv->channel_factory == NULL? Why?
tp_proxy_get_factory() is always guaranteed to return non-NULL on
TpAccountManager (and some other TpProxy) because they have
_tp_proxy_ensure_factory() in their constructed(). AM rely on it to create its
TpAccount objects too.
>
> - g_return_if_fail (TP_IS_CLIENT_CHANNEL_FACTORY (factory));
>
> tp_clear_object (&self->priv->channel_factory);
>
> - self->priv->channel_factory = g_object_ref (factory);
> + if (factory != NULL)
> + self->priv->channel_factory = g_object_ref (factory);
>
> You should probably not remove the type check.
The difference now is that factory given could be NULL, but I guess I could
change to (factory == NULL || TP_IS_CLIENT_CHANNEL_FACTORY (factory))
--
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