[Telepathy] TpChannelView
Danielle Madeley
danielle.madeley at collabora.co.uk
Tue Aug 24 04:52:44 PDT 2010
On Tue, 2010-08-24 at 12:33 +0100, Simon McVittie wrote:
> Yes ish, but we can't use that naming, because we already have a
> TpChannelFactory in CMs. Also, I think it should probably be a GInterface,
> not a base class.
That did cross my mind.
> How about TpClientChannelFactory as the GInterface, and TpDefaultChannelFactory
> as the reference implementation?
>
> > TpBaseChannelFactory has one method you need to implement,
> > create_channel, which gives you a path, and the properties, and expects
> > you to call whatever preparation you need, eventually calling back to
> > tp_base_channel_factory_channel_ready().
>
> If it's expected to be async, I think it'd be better to have
> create_channel_async and create_channel_finish, and use the GAsyncResult
> pattern.
>
> I wonder whether it should just be synchronous, and do the preparation
> separately, though; if it's async, then we can't use it in any context
> where we need an object synchronously. It seems better to allow for that -
> we'd prefer to get an unprepared object of the right app-specific subclass
> than an unprepared TpChannel, surely?
Perhaps then:
TpChannel* create_channel (Factory, path, properties);
void prepare_channel_async (Factory, TpChannel*);
gboolean prepare_channel_finish (Factory, GAsyncResult*, GError**);
So that you can always create the channel, and then optionally have the
factory do some async preparation that's additional to simply preparing
the core features.
--
Danielle Madeley
Software Developer, Collabora Ltd. Melbourne, Australia
www.collabora.co.uk
More information about the telepathy
mailing list