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 😀

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 😀