dbus notification area protocol implement issues
Marco Martin
notmart at gmail.com
Wed Apr 15 17:52:40 CEST 2009
On Wednesday 15 April 2009, Aaron J. Seigo wrote:
> 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 ...
but syncing up everything every time there is something new doesn't seem
particularly wise, hmm...
> 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.
More information about the Plasma-devel
mailing list