Akonadi Plasma Calendar

I think KDE SC 4.x is becoming better and better. It has reached the point where I don’t even want to think about going back.
Still there are missing bits and pieces every once in a while. At our last Fellowship of the Ring FSFE meetup here in Stuttgart, we had a nice talk… and Björn mentioned that he had almost gotten used to using KDE on his work machine :D
Of course that made me happy for the rest of the evening. Happy enough to think about his one complaint that he had: The calendar of the Plasma panel does not show calendar events (incidences in Akonadi-speak as I learned) from the KOrganizer calendar.

Now I realized that I have a working Akonadi Calendar in my current KDE SC 4.4 release. Putting one and one together this meant creating a Data Engine that provides the calendar events to all of plasma. How hard could that be?
Akonadi is where all the PIM data is stored. Since I had done some Plasma stuff before but never looked at Akonadi before, I poked here first. With the help of Thomas McGuire I had a first prototype application running after one afternoon of asking questions. The next afternoon (this is how I spent my Easter Sunday and Monday :D ) was a round of kicking at Plasma DataEngines. After putting this first round of hacking into playground I got comments from Aaron and Stephen, both made my code much easier and cleaner.
Today I sat down for an hour of cleanup and I think the current state in KDE SVN playground is quite good.

Akonadi is a pleasure to use (knowing a bit about Qt’s Model/View classes helps if you intend to get up and running quickly though). To start getting data out of Akonadi your best bet is probably to start with an ETM… EntityTreeModel – which provides you all you ever wanted (and more) of the PIM storage. Add some of the nice ready made Proxy Models onto it and you should be good to go. In fact I’m tempted to put more of this into other places :)

For Plasma what I learned: Subclassing DataContainer for DataEngines of a certain complexity is a great thing to do. This takes the burden of keeping track of the source requests off of you, simply create on container when a request comes in, it will get removed by Plasma when no longer needed.

Aaron sat down to make the actual Plasma Calendar use the improved DataEngine. It’s almost there, I bet he’ll update you with screenshots soonish… since I’ll miss out on them today.
Now all that is left is waiting for a yummy KDE SC 4.5 :D

6 comments to Akonadi Plasma Calendar

  • luis

    Man! This is very cool! Is there a service to go along? I mean, if I click on an event in the calendar, can I actually see a dialogue to change that event? Anyway, thanks for taking the time to do all this.

    • Frederik

      I do have the idea that a service for this would be good in the back of my head. Currently I’m swamped in work though. So I don’t expect that I’ll get to that shortly :( if anyone wants to write this, I’ll try to help you getting started ;)

  • Marcin

    Hi. That’s greate news! :) Thank you!

    I think about rss widgets to. Is Akonandi support rss? What about Akregator updates?

    • Frederik

      I think that there is RSS support in Akonadi (for Akregator for example).
      What I wrote is only about the calendar though. Creating a very similar data engine for RSS should not be much work.

  • The Akonadi team can also help anyone who wants to create a dialog to modify those events. Just pop into kde-pim@kde.org or #akonadi.

    There is Akonadi support for rss in playground, but it has not yet made it into mainline KDE yet because it is unfinished. Again, help getting that done is welcome.

    @Fredrick: The calendar dataengine seems to be gone from playground already, but I recently changed ETM to be able to retrieve a simple list without collections as you were looking for.

    http://websvn.kde.org/?view=revision&revision=1114349

    http://websvn.kde.org/?view=revision&revision=1116385

    • Frederik

      Hey Stephen, thanks – I updated the engine based on this comment… it’s compiling now and this saves another 10 lines of code :D
      You rock!