My Projects

QCoro

QCoro is a C++ library that makes it possible to use C++20 coroutines with Qt. It provides the necessary tools to create coroutines as well as coroutine-friendly wrappers for native Qt types.

KDE

I have been contributing to KDE for over a decade. I was involved in KDE Telepathy, KScreen and most prominently in KDE PIM. I am Akonadi maintainer and author or Google integration.

cmake-package

A Rust crate for Cargo build scripts that provides a simple way to find and use CMake package installed on the system.

Evolution gets a new e-mail formatter

While porting  Evolution to WebKit, I have made some major changes in how formatting emails in Evo works. But lately I’ve been more and more aware, that it’s not flexible enough and that there is a lot of space for improvement.

With Milan Crha we designed a proper, object-oriented (within the limits of C and GLib) parser and formatter. They are now both very flexible, easily extensible and displaying e-mails is a bit faster thanks to more asynchronous approach.

Example of automated part formatting

The main feature that comes out of this redesign is an extension we call text-highlighter. It uses the highlight utility to format text parts. For now we only highlight diffs and patches, but the list can easily be extended by all formats supported by highlight.

But we intend to go a bit further. We want to allow users to choose how each part should be formatted! The popup menu on each part of the email will contain a list of available (and compatible) formatters. Selecting one will reload the given part (each parts is in an <iframe>) and render it again using specified formatter.

Example of the context menu with available formats
Evolution will format the part using selected formatter

As far as I can tell this is a quite unique feature among e-mail clients  and hopefully it will make lives of our users a bit easier :). This particular feature is not in place yet, but it will included in Evolution 3.6.

Now I’ll spend a week or so by fixing regressions that we missed during testing (quite thorough, as always when Milan tests someting :D ) and that will appear when more people start using it, After that I’ll finally move over to porting the message composer to WebKit.

Stay tuned ;)

LibKGoogle → LibKGAPI

This is just a short note mostly for packagers and other developers using LibKGoogle (if there are any). Due to possible violation of Google trademark, the LibKGoogle library has been renamed to LibKGAPI. Thanks to Clifford Hansen for inventing such a nice name :)

Also the license has been changed and the project is now under GPLv2+ instead of GPLv3+.

The entire API is now encapsulated in KGAPI namespace instead of KGoogle and headers were moved to %prefix%/include/libkgapi.

All these changes are now reflected in LibKGAPI 0.4.0 release, which does not contain any other improvements or fixes. I decided to go directly to 0.4 instead of continuing the 0.3 series, as I consider this a big and important change.

The Akonadi resources for Google services in kdepim-runtime will depend on LibKGAPI 0.4.0, the patch has been already submitted for review.

The git repository is still called libkgoogle, it will be renamed when it’s moved to KDE extragear (or somewhere else). Stable branch is LibKGAPI/0.4.

Tarball release: libkgapi-0.4.0.tar.bz2 (will be available on ftp.kde.org soon)

Thanks and sorry for any inconvenience.

Cheers

Akonadi Google 0.3.1

Hi! Nearly four weeks after the [0.3](https://dvratil.cz/2012/04/akonadi-google-0.3-arrives/ release of Akonadi resources for Google there’s a new version with just a few, but important bug fixes and improvements.

UPDATE: In order to use the Google resources, you either need KDE 4.9 (which the resources are part of), or you need to install LibKGAPI 0.4.1 (or newer) and Akonadi resources from git://anongit.kde.org/scratch/dvratil/akonadi-google-resources. See this discussion for details.

Fixed bugs and crashes:

  • Bug #296541 - Uncaught exception in signal handler in Contacts resource
  • Bug #297824 - Uncaught exception in signal handler in Calendar resource
  • Bug #297548 - Crash at akonadi start after having added a new contact - resource
  • Bug #298054 - Can’t build libkgoogle with KCal
  • Bug #298518 - Unable to edit newly created events
  • Bug #298519 - Deleting events incorrectly reports an error

The first two bugs were especially tricky as I couldn’t reproduce them, but many users were affected by ugly and repeating crashes. But now the “Google experience” is much much better :).

Big thanks go to Alex Fiestas who has contributed various improvements to libkgoogle to better work with 3rd party apps (so now we can be looking forward to his web-accounts wizard :) ).

Sources: akonadi-google-0.3.1.tar.gz (MD5: *fed8d9082547835ab916edd219831cf6)

Bye!

PS: I found this on Akademy wiki, so:

I'm going to Akademy 2012!

Akonadi Google 0.3 arrives

After many months of “I will release it next week” I finally released libkgoogle 0.3 and new version of Akonadi resources for Google this week.

So, what’s new? I managed to implement everything I described in [this post]( {% post_url 2011-11-25-akonadi-google-resource-whats-comming %} “Akonadi Google Resource: what’s coming?”) back in November. That’s support for multiple Google accounts, and merging the tasks resource into the calendar resource (so now it’s called “Calendar and Tasks resource”). The calendar now properly supports events recurrence and partially exceptions in recurrent events (there’s still some work to be done). The contacts resource now splits your contacts to “My Contacts” and “Others” groups. I hoped to fully support contact groups, the code was even in place, but I’ve run to some problems how to store it in Akonadi and unfortunately KAddressBook is not “compatible” with the Google’s concept of contact groups, so I decided to stick with the two elementary groups and hopefully I’ll get to this later (maybe some PIM dev could help me on Akademy? ;) )

If you run to any problems or bugs, please report them to the libkgoogle product in bugzilla.

Finally, I’d like to thank to Jan Grulich and Vojtěch Zeisek for putting their contacts and events at risk to test the pre-release versions and provided valuable feedback.

Sources

(Updated tarball!) akonadi-google-0.3.tar.gz (md5: 8c5c1e015068bea90bf25dd7858dc913)

If you want to follow the most recent development, you can use sources from the master branch.

Have a nice day!

Evolution meets WebKit

Evolution is the default email client, address book and calendar application in GNOME. It has large variety of features, including support for Microsoft Exchange and Google services. But it’s weak spot for some time now has been a poor email renderer. Evolution is using GtkHtml, which cannot compare to today modern HTML renderers.

And so, eight months ago, after working on Evolution for about 5 months, I took the webkit branch after Matthew Barnes and begun to dig into depths of Evolution’s email formatter, parser and renderer and started porting it to WebKit. Today all the work has been merged to the main branch and Evolution made it’s first step towards leaving GtkHtml behind.

So what’s new? Many things! Thanks to GObject introspection in DOM bindings we can modify the rendered emails on the fly without parsing and rendering the entire email again. This makes expanding and collapsing headers and attachments previews much faster, smoother and improves the overall user experience.

Another benefit for users is full support of CSS. While GtkHtml does not support any styles, WebKit does. This means that various newsletters and flyers are rendered correctly and with all the details. WebKit has also first-class JavaScript support, but don’t be afraid. Scripts were disabled so that your emails and comfort are safe.

The invitation preview plugin has been rewritten to be completely in HTML, so it’s much easier to copy text from it, while all it’s functionality remains preserved (using DOM bindings again). It also makes it possible to print the invitations and events previews.

When I was rewriting the formatter, I have also looked on printing. Print-outs now look fresher, are better formatted and the content is better structured. I have also added a brand new feature, which allows you to select which email headers and in which order should printed. This option is available directly in the printing dialog, in “Headers” tab.

Printout from Evolution 3.2

Printout from WebKit-based Evolution

Preview of headers configuration in printing dialog

The port is ready for daily use, but there might still be bugs hiding at various places. Therefore the changes we merged so early after 3.4.0 release, so that we have enough time before 3.5.1 to catch them all and at least 6 months until 3.6 stable release to make sure that everything is perfectly in place.

And what’s going to happen next? I will now start porting the email composer to WebKit. If things go well and smoothly, I might make it to have it in Evolution 3.6 this Autumn and thus getting rid of GtkHtml once and for all.

Bye!

KDE Telepathy plugin for KRunner

Yesterday I have switched from Kopete to KDE Telepathy. At first I only wanted to see what’s new, but I was quite impressed and I didn’t see any problem that would keep me from using KDE Telepathy instead of Kopete. Except for one - a contact runner. I’m an incredibly lazy creature and instead of having to remember various shortcuts or even touching mouse, I rather use KRunner for nearly everything, including starting chat with my IM contacts.

In the true spirit of open source, instead of whining about a missing feature I decided to take an action and write the plugin myself :)

Same as with Kopete Contacts runner, just by typing name of your contact will display matching contacts in KRunner. If you have one contact in multiple accounts, it will display the contact multiple times, with name of the account as well.

The results are sorted by presence, e.g. if a person is online on Jabber, but offline on GTalk, the Jabber contact will be listed first.

If the contact has capabilities for audio or video call, file transfer or desktop sharing, you will see multiple buttons. By default, just by hitting Enter on the selected contact will start text chat, but by clicking on one of the buttons you can start the respective action. If the other side does not have some capability, it’s button will not be displayed.

If you want to explicitly start for example an audio call, typing “audiocall John” will list all contacts named John capable of audio call and clicking on it or hitting Enter will start an audio call immediately. Similarly there are commands “videocall”, “sendfile” and “sharedesktop” for respective actions.

This last feature is untested though, because none of my contacts seem to use KDE Telepathy or have any capability other than text chat :D

Here is some artificially made screen shot :)

KDE Telepathy Contact Runner example
(Ignore the KSnapshot icon, I had already removed all the code to generate this preview when I noticed it :D )

You can get sources from my scratch repo on KDE git:

git://anongit.kde.org/scratch/dvratil/ktp-contact-runner.git
git://anongit.kde.org/ktp-contact-runner.git

And finally, big thanks to all our telepathic guys for their great work on the framework :) Keep it up!

Bye

KDE Google Reader

I’ve made a big progress with the upcoming libkgoogle 0.3 last weekend on the Fedora KDE SIG meetings which took place in Brno. I then decided to take some rest from all this Google things and wanted to relax by working on something else. But then I remembered that some time ago I experimentally implemented the Google Reader API and…well, see for yourself.

KGoogleReader integration with Kontact

Originally I wanted to implement my own caching mechanism for the feeds, but I soon realized that I would be just wasting my time when there already is something as cool as Akonadi.

I have written a simple Akonadi serializer for the data (took me about 20 minutes) and an Akonadi resource (that took me about 40 minutes to write). Finally I begun to write the client.

The client itself is very simple, it essentially only fetches list of streams (for those unfamiliar with Google’s terminology, stream == RSS feed) and their content from Google Reader and is able to update ‘read’ flag of one or more items. You can’t add or remove streams (maybe later).

Note: Do not try to “mark all as read” if you have too many unread items. The resource is sending a HTTP request for *every single item (will be fix later, maybe…).

But hey, what’s the difference between reading your feeds in a browser window or in a silly desktop client. To increase the level of (my) awesomeness I’ve made a Kontact plugin as well:

KGoogleReader integration with Kontact

Btw, does anyone know how to change order of the items in the left pane? I’d like to have the reader where Akregator usually is :)

In the first sync, the resource fetches up to 200 latest items form each feed (I think that’s a reasonable amount), then the updates are incremental. There is no progress indication, so just be patient.

In a way it is a “replacement” for Akregator (but it lacks almost all of its features :-), so actually it’s not…). I suppose you don’t need to have local feeds in an RSS client when you can interact with feeds on Google Reader directly. On the other hand, it’s not a serious project, more like a preview or demonstration of power and awesomeness of the KDE technologies (it’s so simple to use Akonadi!) and all the people behind it. When libkgoogle 0.3 is out and stable, I’d like to dedicate some time to help with the Akregator port (if it’s not finished until then), so this project will just rot in git, forgotten.

As I said, this is more of a tech preview, definitely not something for daily use. I won’t be spending much time working on it, but of course, feel free to clone the repo (see below) and contribute.

How do I get this?

  1. You have to use libkgoogle from the experimental “reader” branch. This branch is rebased against the development branch of what-will-become-0.3, so it’s completely incompatible with the current resources from master branch.
cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DBUILD_calendar=FALSE -DBUILD_contacts=FALSE

I recommend to install libkgoogle to some other prefix then /usr so that it does not conflict with the stable libkgoogle library, but if you feel brave enough, you can try to compile the branch with calendar and contacts resource as well, since they are mostly finished and working (and I would appreciate some feedback before releasing it).

  1. Compile the Reader. The repository contains all the stuff - Akonadi serializer and resource, Kontact plugin, KGoogleReader KPart and KDEGoogleReader application (sorry for the KDEGoogleReader vs. KGoogleReader inconsistency, I couldn’t decide how to name it so I was mixing both names :) )
git clone git://gitorious.org/kgooglereader/kgooglereader.git
cd kgooglereader
mkdir build && cd build
cmake ../ -DCMAKE_INSTALL_PREFIX=/usr -DLIBKGOOGLE_LIBRARY=/usr/local/lib/libkgoogle.so -DLIBKGOOGLE_INCLUDE_DIR=/usr/local/include/
make
make install # as root

Remember to replace the path to libkgoogle by wherever you have installed it. Now you should have kdegooglereader executable installed and when you restart Kontact you should see “Google Reader” in the left pane as well.

Well, I hope you like it :)

Akonadi Google Resource: what's comming?

Post thumbnail

It’s been a while since my last blog about the Akonadi Google resources and since my last contribution to the project (except for a few minor bug fixes lately). Today I decided to change it (at least the former) and show you that the project is still active (I just don’t have much time to work on it) and reveal to you what big changes I plan to do in the near future.

There are two questions people are often asking me: if it is possible to support multiple Google accounts and why are calendars and tasks split to two resources. If you are one of those people, I have good news for you: next release will support multiple Google accounts and the Tasks resource will be merged to the Calendars resource.

Because words are plain, I will rather show you some pictures of how I imagine the resources could look like.

The first image is the new preferences dialog for Calendar resource. In the first list, there will be list of all accounts. The list will be common for all resources, so you will see the same accounts in the Contacts resource as well. Below is the list of calendars for the selected account (the list will auto-update itself when you choose another account + there will be something like “Reload” button to update the list by hand) with possibility to create, modify or remove existing calendars not just from Akonadi, but from Google server as well. The last list view is for task lists.

The second image shows how the calendar editor could look like. The are two things I want to change yet: replacing the wide color combo box by a single button which will popup another dialog with list of colors to pick from (according to docs Google supports only limited set of colors for calendars) and I’d like to have the timezone list displayed as a combobox instead of a tree view. The editor for task lists will look similar.

Regarding editor of accounts, clicking on “Create” will simply display the Google login page, same as it does now when you click on “Authenticate” in the resource preferences dialog. Given second thought, the “Edit” button does not make much sense since you can’t change anything (maybe just the name of the account), “Remove” will just revoke the authentication.

And finally, on the last image you can see how the list of calendars in KOrganizer could look like. Each account would have sublist of calendars and tasks lists. The image is very inaccurate (copy&paste in Gimp :)), only calendars you have selected in the “Calendars” list in the preferences dialog will be displayed in the list and there will be task lists displayed as well (again, only the task lists you choose in the preferences dialog).

So, do you like it? :) I don’t have much time now and collage exams are closing in, but I hope to find some time during Christmas and as I know myself I will be hacking this new features all January instead of learning for the exams :)

And just to list some improvements since last time: we now support categories for calendar events, information about contact group membership is synchronized (you can’t yet move contacts between Google’s contact lists, but at least the resource does not automatically remove your contacts from the lists) and some issues with timezones and daylight saving were fixed.

And finally (I almost forgot about this) some more good news, especially for Fedora users: I’ve created a project in OpenSUSE Build Service, so you can add a repository to yum to have access to fresh Akonadi Google resources :) I’m will rebuild the packages after every important git commit, so you will be still up-to-date.

Fedora 16: http://download.opensuse.org/repositories/home:/progdan/Fedora_16/

Fedora 15: http://download.opensuse.org/repositories/home:/progdan/Fedora_15/

The project itself is available here: https://build.opensuse.org/package/show?package=akonadi-google&project=home:progdan

Fell free to modify the .spec file to support other distributions as well, I don’t have much skills in packaging .specs for anything else but Fedora :)

And if you just want to build the project from sources, you can get them from akonadi-google repo in KDE git: git clone git://anongit.kde.org/akonadi-google

Cheers,

Dan

UPDATE: In OpenSUSE, you can find snapshots in the KDE:Unstable:Playground repository: https://build.opensuse.org/package/show?package=akonadi-google&project=KDE:Unstable:Playground

Akonadi Google Resource: Tasks support

Hi!

As the title says, I just added support for Google Tasks by creating the Akonadi Google Tasks Resource. The Tasks API provided by Google is really simple and does not support many properties, only name, summary, due to date, completed date and status. You can’t set progress percentage, start date, attendees nor reminders (this sucks!). Despite the fact, that the API provides means for tree-like structure of tasks (tasks and subtasks), it does not seem to work. So you can only have a linear list of tasks. A positive thing is, that due to this limited functionality of Google Tasks the resource has a full support of this API.

The reason for independent resource is that you can have multiple task lists in Google Calendar, thus merging this functionality into Google Calendar Resource is not an option. Unfortunately, you will now have the tasks resources displayed in the list of calendar resources in KOrganizer.

The second and very important update is, that we now have a product in KDE Bugzilla, so you don’t have to report bugs in comments here. The product is “libkgoogle” so you can report bugs or whishes here: https://bugs.kde.org/enter_bug.cgi?product=libkgoogle&format=guided.

If you think you have posted a request/report under an earlier blogpost and I still haven’t responded/fixed/implemented your request, please report it again in the bugzilla.

Sorry, no screenshots today :)

Bye!

Akonadi Google Resource: complete rewrite

Hi there,

today I finally pushed a completely new version of the Akonadi Google Resource. Since last update cca 2 months ago I’ve completely rewritten the resources, moving most of the functionality into libKGoogle. The library now provides access to Google services and can be easily used by any other project.

So what’s new? A lot of things changed for programmers. I’ve begun to fulfill my threats about providing a C++/Qt library for accessing Google Services. It’s not pure Qt, I’m using some KDE stuff in there, but that will change :)

LibKGoogle now provides API similar to QNetworkAccessManager (KGoogleAccessManager) through which you can send KGoogleRequest and if it works, you’ll receive a KGoogleReply. Each Google Service is represented by a KGoogleService subclass, implementing XML and/or JSON parser and serializer and providing informations about fetch/create/update URLs. Each object (contact, event, calendar) is represented by KGoogleObject subclass. For now, Event class is implements KCalCore::Event as well, the Calendar and Contact classes provide their own implementation of everything. Porting it to KABC/KCalCore is on TODO.

libKGoogle provides unified authentication framework and stores the tokens in KWallet. For now, you can only use one account per service (means that you can’t have two calendars from two different Google accounts), but this is on my TODO as well. The framework is also able to automatically refresh the tokens when they expire, so that should fix the problem with “resources forgeting the authentication”.

The API needs some more polishing and I must somehow force myself to write documentation, but the I think the libKGoogle can provide a solid base for any Google-related services.

The library is still in the same git repository with the Resources. I will try to move it to it’s own repo when it gets support for more services and the API will really stabilize.

Contacts Resource new Settings Dialog
Contacts Resource new Settings Dialog 2

From users’ point of view, there is just a very slight change in Contact Resource settings dialog. There are no new features in any resource. Though there are probably many new bugs :F So please try it out and don’t be afraid to spam me with any issue, idea, problem, comment, invitations to a beer etc…:)

With libKGoogle I hope more developers will begin to create Google-related applications for Qt and KDE. This library could one day be a good start-point for them.

Plans for future versions:

  • support more contacts and event properties
  • support multiple Google accounts per service
  • changing contact photos
  • tie KGoogleObjects to KCalCore and KABC
  • API cleanup
  • DOCUMENTATION :/
  • make the libkgoogle optionally KDE-independent (long-term plan)