playground/base/plasma/dataengines/akonadi

Sebastian Kügler sebas at kde.org
Mon Feb 9 18:01:26 CET 2009


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.

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.

> > SVN commit 923483 by sebas:
> >
> > birthday, location and photo for the akonadi dataengine contacts part
> >
> > In more general, the dataengine works as follows:
> >
> > For email:
> > -----------
> > - request "EmailCollections", you'll get a list of EmailCollections-<id>
> >   as key and the name of the collection as value.
> >   (The list of collections is loaded on demand)
> >
> > - Choose one of those collections by request the ID
> >   (EmailCollection-<id>). The dataengine now queries Akonadi for all
> >   emails in that collections and will add a new source for every email.
> > In you dataUpdated() method, you can simply check if the
> >   source.startsWith("EmailCollection-") and then query the data from that
> >   email.
> >
> > Properties you might be interested in for those email source are:
> >  - QDate DateTime
> >  - QString Subject
> >  - QString From
> >  - QString To
> >  - qlonglong Id
> >
> > The Id can be used to query Akonadi for the body of the email. That part
> > is not yet included in the Akonadi engine, but might come in the future.
> >
> > For Contacts:
> > --------------
> > - request "ContactCollections", choose one of those and request
> >   "ContactCollection-<id>".
> > - request one of those collections ("ContactCollection-<id>")
> > - New sources for every contact in that collection will appear. You can
> >   now get at the Contacts data through the following fields in that
> >   particular source:
> >
> >  - double longitude
> >  - double latitude
> >  - QString Organization, Role, FullEmail, Name, Department, Emails,
> >    various Phone- numbers
> >
> > Work to get those datasets more complete is under way. What's in should
> > already provide for most of the use cases you can dream of.
-- 
sebas

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



More information about the Plasma-devel mailing list