You are using an obsolete web browser, or you have the page styles (CSS) disabled. You'll be able to access this site, but only a visually simplified version.

First activities client application

At last Tokamak (Plasma developer sprint), I’ve made a small KWrite proof-of-concept patch just to see how it will behave with the new activities framework – notifying system when it opens and closes a document. A lot of time has passed since, and activity classes were completely revamped, turned upside-down, went through one API review, and moved from the playground to kdebase/libs.

That original patch doesn’t exist anymore, and even if it did, it wouldn’t work for all the changes that were made to activities.

The uber-awesome KDE conference – aKademy – was a time for something new!

New client

Ok, after this introduction you’d expect that I’ve written another patch for KWrite. Well, you’re wrong. The first application that supports activities as a client is Vim! :)

The main reason I went for Vim this time was to prove that non-kde apps can work with our awesome concept of activities. Another reason is that I didn’t want to use KActivity* classes, so that I can see whether the d-bus protocol is sufficiently profound for this task. It turned out that it is, but there are some improvements to be made.

At the moment, only Vim invoked from a terminal emulator program (eg Konsole) can work with activities since I can’t find a way to retrieve the window id of a GUI-enabled Vim from vimscript, so I’m essentially using WINDOWID environment variable that terminal emulators set.

The following is a debugging output of the activity manager daemon related to Vim windows

resourceWindowRegistered: 54526034 file:///home/ivan/mailacc.txt
resourceWindowUnregistered: 54526034 file:///home/ivan/.vimrc
resourceWindowRegistered: 85983274 file:///home/ivan/
resourceWindowRegistered: 85983274 file:///usr/share/vim/vim72/doc/options.txt

Truly limitless possibilities!!!

^^^^ just wanted to write an awesome marketing-speak sentence for the end of the post :D

Tokamak 4: Activities

This one will be short, I don’t really have the will for writing – it is half past midnight here.

The activities infrastructure is mostly finished – now only polishing is left to be done.

The new organization goes like this:

The core activity-related features are placed into a kded module which doesn’t depend on anything but Qt and the core kde libraries. The class for writing the clients of this service (any program that wants to be able to react to activity changes etc.) will be in kdelibs. The API is minimal and very easy to use – it took me only a couple of minutes to patch KWrite to be able to use activities.

The second part is the revamped Nepomuk Activities service (I already blogged about it – the changes made at T4 were mainly related to make it fit the new arhitecture). If it is running, the above class passes all the info to it. Running the service enables the access to extra meta-data regarding documents and activities.

The third, and last part is the manager class which will be in kdebase/workspace (most probably) because it is only intended to be used by kwin and plasma. Normal programs shouldn’t use it.

The next step is the UI – kwin and plasma

Cheerio.

Nepomuk/Plasma Activities

Unfortunately, the activities service didn’t make it into 4.4 because there wasn’t enough time for it to pass on from kdereview into kdebase. This means that it was returned to playground for further processing. :)

The service has grown a bit and now it exposes a few more methods like linking activities to other nepomuk resources (documents, places…).

KIO

Since the service is not really useful by itself (from the user’s point of view), it will need some kind of UI. The main UI will be Plasma and the ZUI replacement which will be one of the Tokamak4′s main topics.

For the time being, I made a KIO slave shown in the picture above. It lists the defined activities and the resources linked to it. At the moment, the resources are limited to Applications, Documents, Places and Contacts (I’ve just realized that those are the same sections that are in Lancelot – completely by accident).

The data shown in the picture is a garbage data I put into nepomuk for the sake of testing (no sane person would put Thumbs.db in the work-related documents. :)