playground/base/plasma/dataengines/akonadi

Sebastian Kügler sebas at kde.org
Mon Feb 9 21:52:58 CET 2009


On Monday 09 February 2009 21:28:17 David Baron wrote:
> > On Monday 09 February 2009 08:37:48 David Baron wrote:
> > > Great.
> > >
> > > I downloaded and compiled.
> > >
> > > I still get "no data sources" in the explorer and in some test code
> > > which would simply show the sources() list.
> >
> > You need to actually request sources. For example connect to
> > "EmailCollections" or "ContactCollections". The dataengine will only load
> > the stuff from Akonadi you actually ask for.
>
> OK.
>
> In the explorer, requeted ContactCollections
> This showed by a ContactCollection-6 dir address book
> If I the request ContactCollection-6, I do indeed get all the contacts by
> number. Trying to navigate this (now large) list quickly hangs up the
> explorer.
>
> > Alternatively, add
> >
> > fetchEmailCollections();
> > fetchContactColletions();
> >
> > to the constructor of the dataengine. This way it'll load the collections
> > on engine startup. You can then use the collections you get back to
> > retrieve emails and contacts.
>
> Because of a pontentially large amount to date, this approach should not be
> used.

Yes of course, otherwise I would have added to the dataengine in the first 
place... It's completely transparant to the user though (thanks to the design 
of dataengines).

> My applet will want to assemble a list of QAbstractListItems or 
> QStringLists something like:
> contact-name phone-number-1
> contact-name phone-number-2
> contact-name2 phone-number-1
> etc.
>
> There may be several collection-# lists and a lot of data. Once loaded
> which takes a bit of time, possibly geometric by number of items!,
> kaddressbook seems to run reasonably (using the akonadi dir resource).
>
> I would load the data in a background thread--question is how long it will
> need to load and be navigated to fill a sorted listwidget. I guess I'll
> just have to try it out and see.

The loading of data in the dataengine is async. Don't block on it but react to 
signals announcing new datasources instead. Look at lionmail.cpp for an 
example.

> Another problem is that there are a slew of Akonadi-???-resource children
> (which I try to renice using and as this stuff bogs down the system). I
> believe that many of the complaints about 4.2 being too slow are because of
> akonadi and maybe nepomuk--these need to be niced and means of
> servicing/optimizing the data, i.e. eliminating duplicate contacts which I
> got accidentally, need be provided.

Can't really comment on those, please email the appropriate lists with the 
issues ...
-- 
sebas

 http://www.kde.org | http://vizZzion.org |  GPG Key ID: 9119 0EF9 



More information about the Plasma-devel mailing list