[Kde-pim] How to use akonadi

Eduardo Robles Elvira edulix at gmail.com
Thu Sep 3 19:05:03 BST 2009


On Wed, Sep 2, 2009 at 11:04 PM, Mantia Andras<amantia at kde.org> wrote:
> Tobias Koenig wrote:
>
>> On Wed, Sep 02, 2009 at 04:28:12AM +0100, David Jarvie wrote:
>> Hej David,
>>
>>> I've looked for example code, and looked at the API documentation
>>> (including the Akonadi overview there), but I'm at a bit of a loss to
>>> know how to start. It would seem that the right thing might be to create
>>> an Akonadi::Collection instance, but I'm not sure, and what to do after
>>> that isn't clear.
>> You have to use the Akonadi::(Item/Collection)XyzJobs from
>> kdepimlibs/akonadi to load, modify and save the items and collections.
>>
>> So the first step is to use a CollectionFetchJob with the start collection
>> set to Collection::root() and type set to Recursive. Then in the finish
>> slot of this job you can trigger an ItemFetchJob for every returned
>> collection. Then you can iterate over all returned items and filter out
>> everything that has not the wanted mime type.

Hi!

I'm not sure if this would be the right approach, but you could use
Akonadi jobs to create, delete and modify alarms as suggested, but
then you could also at the same time use an items' model to maintain
an updated list of the alarms. This way in case if there' other
processes modifying the alarms you will get automatically the updates,
and you don't need to write the logic to get the alarms yourself. You
could inherit from Akonadi::ItemModel and watch for updates (connect
to signals like dataChanged, columnsInserted, columnsRemoved).

Just my 2cts =)
   Eduardo Robles Elvira
_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/



More information about the kde-pim mailing list