#24: GSoC with KDE Now – 3

Hey ! I’m making KDE Now, an application for the Plasma Desktop. It would help the user see important stuff from his email, on a plasmoid. It’s similar to what Google Now does on Android. To know more, click here


It’s been some time since the coding period started for this year’s Summer of Code. I had exams till 27th of May, so I started from 28th. My mentor knew about it already, so things went buttery smooth.

As the first part of my project, I had to implement an IMAP client for fetching emails from an IMAP server. I used KIMAP library in the process. With the help of my mentor and Daniel Vratil and Luca Beltrame, I implemented a working IMAP client. Daniel and Luca helped me with the API details, since the one available was lacking some of the details. Still, most of the methods were fine. The only minor issue related to the API was a specific function overloading in KIMAP::FetchJob. The new Qt signal/slot mechanism is good and all, but since it does static checking, we need to specify the exact methods. In this particular case, to resolve ambiguity, we need to cast it. Which looks not very beautiful. Hence, Qt recommends not to use function overloading.

There are a lot of details based  on how the whole thing runs. One can look at the commits, I made which are a lot more detailed. But the basic idea is: Start a client session, fetch relevant emails, and go into a laid back state. When the server receives a new email, it notifies our client that a new email has arrived. Our client then fetches the new emails. For future plans, I might as well incorporate information from these commits into docs.

For the coming few weeks, I plan to move the update procedure of the client to a different thread, as when I was writing a processor today, to process the newly fetched emails, I noticed some lag. For this, I will use QThread. I’m kinda amused that I didn’t think of this happening before !

Testing the client took time more than I expected. Actually, I tested the whole thing.I exchanged some 60 emails for this purpose. I plan to write unit tests later (in the final stages, which is like 2 months away).

This is the first time, I’m making a project like this from scratch and it has been a great learning experience till now. I plan to get my current code reviewed by some more people, before I am finally satisfied with it. I’d like to get tips on how to better refactor it, and any general tips for the code/classes design are welcome. Find the repo here.

Things are in pretty good shape. I plan to write extractors in the coming weeks and getting code reviews 🙂 I’m actually a bit ahead from my proposed timeline which was altered due to some changes. That gives me even more time later to work on docs and testing.

Catch you in the next one !



Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s