dbus notification area protocol implement issues
Aaron J. Seigo
aseigo at kde.org
Wed Apr 15 00:36:34 CEST 2009
On Tuesday 14 April 2009, Marco Martin wrote:
> On Tuesday 14 April 2009, Aaron J. Seigo wrote:
> > On Tuesday 14 April 2009, Marco Martin wrote:
> > > On Tuesday 14 April 2009, Aaron J. Seigo wrote:
> > > > * all the dbus calls are synchronous; i think those will need to get
> > > > changed to be async otherwise we're going to get some horrific
> > > > situations where plasma sits and times out for a few minutes while an
> > > > application sits there busy and grinding away ..
> > >
> > > hmm yeah..
> > > how to do it? since when i access a property i actually need the
> > > response..
> >
> > well.. there the ones we need response from and the ones we don't... the
> > ones we don't are easy...
> >
> > e.g. calls to ContextMenu can be replaced with call(QDBus::NoBlock,
> > "ContextMenu", x, y) and nothing will really change
> >
> > the good news for the other ones is that they are all in methods that do
> > not return anything. which means they can get called with a callback and
> > when the call returns the result can be dealt with then.
> >
> > it does mean that some of the methods will need to be broken up into an
> > annoying cascade of calls :/ in particular, the tooltip calls in
> > syncToolTip. perhaps we should have a ToolTip method on the bus that
> > returns an array/struct/dict of all the tooltip data at that time?
>
> moved tooltip stuff to a single call.
> also the icon stuff has some problems, since i have to check for both an
> icon name and an icon picture, hmmm thinking about it with a quite long
> chain of callbacks should still be possible...
> but the main roblem is that callwithcallback doesn't seem to work with
> properties? (this patch hmm doesn't work)
after consulting with Thiago, i found out why: properties aren't methods. you
can't call them, you can only get them.
we are all, apparently, a bit spoiled by Qt ;)
so .. we an either make them methods and call them as we do everything else,
or else use something like this (thiago's code)
QDBusMessage message = QDBusMessage::createMethodCall(interface->service(),
interface->objectPath(), "org.freedesktop.DBus.Properties", "GetAll");
message << interface->interfaceName();
QDBusPendingCall call = interface->connection->asyncCall(call);
then connect up call ...
this would also reduce roundtrips considerably, and roundtrips are the
expensive parts, more so than shipping the actual data. so grabbing as much of
the data at once is (as we now do with the tooltips :) is a good idea for
performance.
--
Aaron J. Seigo
humru othro a kohnu se
GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA EE75 D6B7 2EB1 A7F1 DB43
KDE core developer sponsored by Qt Software
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
Url : http://mail.kde.org/pipermail/plasma-devel/attachments/20090414/d25ce097/attachment.sig
More information about the Plasma-devel
mailing list