Querying the dict dataengine

Sebastian Kügler sebas at kde.org
Tue Aug 25 14:04:03 CEST 2009


On Thursday 20 August 2009 10:32:50 Aaron J. Seigo wrote:
> On Monday 17 August 2009, alan moore wrote:
> > The delay wasn't really the problem, but rather the initial bogus
> > output.  I guess I'm thinking of this like a database query -- ask a
> > question, wait a bit, get an answer.  I can see how connectSource()
> > makes sense in a situation where you have a constant stream of data you
> > want to tap into and pipe out to a widget, but is there not a mechanism
> > for simply doing a one-off query?  I thought that's what the query()
> > method was for, but that wasn't working out either.
>
> well, no. because in this case the result is fetched asynchronously. which
> means the only way to do what you want would be to block all of plasma to
> wait for the data. that's obviously not good :)
>
> query() doesn't _really_ provide a synchronous interface, it just provides
> synchronous access to data that already exists. not great in that sense,
> but useful at times.
>
> another thing that's a bit annoying is that we have no way to tell
> currently between between "empty set of data is the correct answer" and
> "empty set of data right now, will be filled in later", so in the case of
> the async call there's always a first call with an empty data set.
>
> i think i'm going to try a patch in trunk where we don't send the initial
> data out if the data set is empty on creation and see if that trips
> anything up. i think it will probably match people's expectations
> better.....

I ran into this problem some time ago, basically. The APIDOCS say that if you don't 
have data right away, you're supposed to set empty data in the engine. I'm not sure 
what the exact problem was anymore, but it did take me some time to figure out. 
(Figure out that reading the docs once in a while saves time, of course. ;-)).
-- 
sebas

http://www.kde.org | http://vizZzion.org | GPG Key ID: 9119 0EF9
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 489 bytes
Desc: This is a digitally signed message part.
Url : http://mail.kde.org/pipermail/plasma-devel/attachments/20090825/192f7efe/attachment.sig 


More information about the Plasma-devel mailing list