[Telepathy] API Draft for high level tubes in tp-qt4

Olli Salli ollisal at gmail.com
Mon Apr 19 10:24:19 PDT 2010


On Sun, Apr 18, 2010 at 4:09 PM, Dario Freddi <drf54321 at gmail.com> wrote:
> Hello all,
>
> as discussed with Andre on IRC, I drafted a small API for managing Tubes in
> tp-qt4 (see attachment). There's really nothing fancy here: it's a quite
> straightforward mapping of the spec to a Qt-like API, and it's mostly what tp-
> glib does as well.
>
> Still, I'd find it cool to provide a function returning a QAbstractSocket for
> StreamTubes and a QDBusConnection (or a DBusProxy) for DBusTubes to make it
> extremely easy to use the opened tube. I'd like some feedback on that though,
> since I don't know how much it would be feasible.
>

I think it is very desirable to target this level of abstraction. For
D-Bus tubes, there's a connectToBus(address, name) function in
QDBusConnection, which can be used straightforwardly, provided it
actually works and/or is easily fixable, of course. Then again, if we
have this, it probably doesn't even make much sense to expose
Pending{Accept,Offer}DBusTube. The address is not useful before the
tube reaches Open - why not just have applications wait for
tubeStateChanged() to Open after firing Accept / Offer, and access
connection() (and/or an "advanced" address()) on the DBusTube class?
In a sense, this is similar to the behavior of TpQt4 Connection where
it's guaranteed to have all previously requested features (analogous
to Offer / Accept) ready when it signals statusChanged to Connected
(analogous to tubeStateChanged).

Similarly for stream tubes, QLocalSocket and QTcpSocket include
suitable connect() methods. Note that QLocalSocket doesn't derive
QAbstractSocket (I think QAbstractSocket is a bit gah for a baseclass)
 so you need to return a QIODevice actually.

Additionally, there's one more point high-levelness I'd like to
incorporate: I think you should add createStreamTube,
create(Group)DBusTube on Account with suitable parameters (ie.
mandatory serviceName for DBus tubes, service for stream tubes).

> --
> -------------------
>
> Dario Freddi
> KDE Developer
> GPG Key Signature: 511A9A3B
>
> _______________________________________________
> telepathy mailing list
> telepathy at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/telepathy
>
>



-- 

Br,
Olli Salli


More information about the telepathy mailing list