Dropping $stuff onto Plasma

Earlier this year, while working on Lion Mail I wanted to be able to drag and drop references to items stored in Akonadi, I ran into some limitations we had in Plasma — in KDE 4.3, it is basically only possible to drop local files onto Plasma, with some exceptions. Think of dragging a photo from your file or image browser onto Plasma, and it offers to create a picture frame plasmoid on the desktop (or netbook, or whatever Plasma shell you use). or The underlying problem is the mimedata dropped either contains a URL or mimedata. The second case is clear, get the mimetype, find applets that can deal with it, add such an applet to the desktop and pass it the mimedata as arguments. Applets can specify, as parts of their metadata (actually an entry in their .desktop file) which mimetypes they support. For remote URLs, it’s not quite simple. It’s generally not possible to safely derive the mimetype of the data a link points to from its URL. The mimetype needs to be retrieved from the remote object (in most case, this doesn’t involve downloading the whole file, luckily, but just asking for the mimetype). As it’s likely a network operation, it can potentially take forever. We need to make sure we don’t freeze Plasma while waiting for the mimetype, so it has to be asynchronous. What we’re doing now when a URL is dropped, we start a KIO Job to retrieve the remote file’s mimetype, as long as the job’s running, we show a menu with a spinner, and repopulate the menu with suitable applets once the mimetype is in. The job retrieving the mimetype is then put on hold, and marked ready for reuse. This trick speeds up loading of the content from the applet, and the connection doesn’t have to be renegotiated. This mechanism works well now, I actually got it to work during the hacking sessions at GCDS, and merged it a few weeks later into KDE trunk/ to be part of KDE 4.4. Aaron has done a screencast showing this mechanism for wallpapers, it’s pretty neat.

(You can download an ogg version on blip.tv as well.)

The problem with this mechanism is that it’s not flexible enough for a couple of things I’d like to do, especially not for Akonadi, and also not for applets we want to create based on a specific web service, or anything else that you can safely derive from the URL. I’ve been thinking about a good solution for this for some time, but didn’t have high hopes to actually make it work in time for KDE 4.4, with the feature freeze looming in only a couple of weeks. On Sunday, I had told Steve (he asked for Akonadi/Plasma interaction, see below) that KJots notes (which are stored in Akonadi) should be drag’n’droppable between Kontact and Plasma (and possibly other applications), and that the way to go would be to pass around typed references to akonadi items by URL (basically akonadi: as protocol, the item’s unique id and its type wrapped into a URL). A lame suggestion in fact, since I knew it wouldn’t work. Then I figured if Plasma::Applet could just tell me which applets are suitable for a given URL (a mechanism similar to the mimetype-based finding of applets), we’d be peachy. Hacked up a patch for that and got it working just before I went to bed, had some good feedback the next day. So I went to clean up and optimise the patch a bit, had it review-boarded overnight and committed it this morning. Applets can now provide matching patterns for URLs. You put a wildcard (or a list of wildcards, useful if you want to cover some subdomains, but not others), in the .desktop file of the applet like this:


You can use the usual wildcard syntax, and put in multiple patterns (separate them with a “,”). This makes your applet automatically appear in the popup you get when you drop something onto Plasma. The patch weighed in at 35 new lines of code, quoting Aaron “impressive what’s possible with so little code”.

On an semi-related note, Lion Mail is getting better with every Qt release. Painting and clipping problems I had in scrolling with graphicswidgets seem to be gone completely when using Qt 4.6 snaps. Some automatic relayouting issues remain. Lion Mail’s Email QGraphicsWidget (the canvas-based equivalent to a “normal” QWidget) used dynamic relayouting pretty heavily, as it shows different parts of an email based on the screen space available for the applet. I’ll have to revisit some of this, it might be interesting to take the concepts and implement them using QML & declarative UI tech for that, and also making use of the Pure Awesomeness of steveire’s Elite EntityTreeModel for Akonadi. I’ll let him figure out how this works best for KJots first, though. :)

NLUUG Fall 2009: The Open Web

Just returned from the semi-anually dutch UNIX user group conference. This fall’s edition, which was today, was titled The Open Web. I had a presentation scheduled, titled Freeing the web from the browser. I talked about ways how we can overcome limitations of the web, such as fitness for very small and very large screens, different input methods, caching, and generally making online data available to rich client applications in a meaningful way. I managed to completely avoid using the term “Cloud”, I’m proud of that. A combined roadshow for Akonadi (while my fellow KDABians are chipping away at the Kontact/Akonadi porting) and Silk, so to say. The talk was well received by its estimated 70 attendees (ok, given the size of the conference this year), with only one person asleep (front row, and at least he was a VIP speaker). I also did a first public demo of Selkie, the standalone web application Richard Moore and I have been working on after Akademy. I’m planning to do a screencast shortly, for those two or three people online that would like to see what it is as well.

A couple of notable things happened today in the Marketing of today might also be interesting to share. Jos Poortvliet (of Dot fame) and Frank Karlitschek (fellow board member and social desktop swabian) and Adriaan de Groot (of FSFE and pink whip fame; no whip this time around though, that must be an Akademy thing). We talked a bit about next steps in an effort to put more structure into the various brands KDE has. Right now KDE has many different meanings (a desktop, applications, a community, …). This leads to real practical problems, it is for example hard to explain to everybody that you can run KDE applications also in GNOME, Windows, Mac OS, on Maemo … — it’s called KDE applications because it’s part of the KDE desktop, right? Wrong. That needs fixing though. This probably involves creating a more distinct identity (“brand”) for the desktop / workspace environment and individual applications. This effort is a longer term process, and is well underway already.
Schuberg Philis, the conference’s main sponsor impressed me with a very sensible idea. Instead of having a huge booth with big machines, interesting for geeky folks, the brought in a battery of espresso machines and (so I heard) the dutch champion barista to make coffee. And good coffee it was (I’m still bouncing). Quite a nice marketing performance, not so “in your face”, still a presence suitable for a conference’s main sponsor, in a way that really adds value to a conference — excellent coffee.
The third thing that struck me was the appearance of rekonq’s new icon (rekonq is a webkit-based web browser which integrates well with other KDE applications and the desktop). The rekonq team has taken Konqi (a young dragon) and turned it into an adult dragon. We’ve been playing with this idea in the KDE’s marketing team some time ago, taking our teenage Konqi and make it a full-fledged dragon, sharp teeth and fire included. Cool to see this in rekonq, I think it’s a neat metaphor especially for this app. I’ve just pulled the latest code from its git repo to give it a whirl.
Fourth, Qt marketeer troubalex a.k.a. Alexandra (sometimes referred to as “trouble alex” by certain very funny people), didn’t make it to Ede due to someone in the family being sick, get well soon from the Netherlands.
I also met Koen Vervloesem, who recently did an interview (the link should be publically accessible by now) with me.

One of the talks I attended was held by Bastiaan Jacques. Bastiaan talked about the status of GNASH, and why it’s important to have a Free flash content viewer, even if Flash sucks and is actually not a piece of technology the “Open Web” should move forward with. During his talk, I downloaded the source and tried to build it. There were some issues building it with my Qt 4.6 installed in a non-standard path, which Bastiaan helped fixing after his talk. I’ve added to my “interesting things to investigate” list to further look at gnash and see in how far it’s suitable for displaying content we really cannot get in a better format than flash (and, by design, easy to integrate also in native client applications).

Another talk I attended was the one by Mozilla hacker Paul Rouget. Paul showed some things that are part of the HTML 5 standard, for example the new video and canvas tags, and then quickly went over to show a bunch of demos what you can do with JavaScript, CSS transformations, SVG and the video tags and canvas tags. Pretty fun stuff, although I have concerns if shipping large amounts of JavaScript code that can even do pixel-based transformation and analysis of image is really the way to go for the web of the future. It doesn’t at least solve problems such as accessibility of data for other applications, it is in fact encouraging putting more and more application logic into web pages, mixing content and presentation and making it hard to actually use the resulting content in a meaningful way (think caching, attaching semantic information or making web pages suitable for different input methods and displays). Pretty entertaining, and a good final presentation anyway (let’s be honest, after a long day of technical talks you’re entitled to some bling).

After the conference, I was invited to the speakers’ dinner, held in a nice restaurant in Ede. Food and conversations were good, and it was nice to learn a bit about others view of various topics. All in all a very interesting, enjoyable and generally worthwhile conference.

Qt DevDays Report Published on Heise; Silk

After visiting the Qt developer days last week (in my capacity as KDAB‘ian, I got the opportunity to train my rusty German a bit. I had been asked to write a report for Heise (a German IT publisher of the C’t and iX magazines). My report has been published yesterday, you can read it here (again, our theme this week is: No English ;-)). So now I’m a journalists (on the Internet, everyone is).
I’ve published a similar article (this time in English, but it went public last week, so it doesn’t count) on The Dot.

Work on Silk is also progressing nicely. I’m getting more and more the hang of Webkit and what cool stuff you can do with it. Richard Moore has just been blogging about our adventures with webkit on QGraphicsView. I had collected some information about that during DevDays and the Maemo summit the weekend before where I met Kenneth (at both events), a Danish/Brazilian QtWebkit hacker and Ariya (the food guy) who patiently answered my questions. More about progress in Silk will be revealed in the coming weeks as we’re making good progress.

Interview with Pardus, Nouvelle Vague

I’ve been interviewed again, and this time the resulting article is published in Turkish, in the Pardus E-Zine. There must be a theme that I always post links to interviews when only parts of the audience can read it. One day, I’ll get you all. The photo’s are universally legible, though. They’re also proof that I’m the most relaxed hacker in the world, an important thing if you ask me.

On Sunday night, I went to Utrecht to see Nouvelle Vague, a French band performing in Tivoli. It was a nice concert, musically on a very high level and with a good portion of fun. The girls, Melanie and Nadeah, were both entertaining and charming (how cute can you be, performing the Dead Kennedy’s song “too drunk to fuck“?), playing some kind of new wave version of good cop, bad cop with reversed dress colors, which gave the concert a very nice touch.

Virtuoso, here I come!

Nepomuk, which is KDE’s semantic desktop framework is a very interesting new technology, and has the potential to move many applications forward. Nepomuk needs an RDF store to save and retrieve semantic information, such as data from your filesystem indexer, tags, ratings, and other, much more complex bits. Up until now, there were performance problems. There were two possible ways to store your information: redland and sesame2. Redland is written in C++, but is very simple and by far not meeting the performance requirement we need for Nepomuk’s use-cases. The Sesame2 backend is a lot better in terms of performance, though still not quite up to the task. What is more, it requires certain Java files which have licensing problems — in the end many distributors just omit shipping this backend. That way performance of Nepomuk goes from bad to worse for many users.
Sebastian Trueg, KDE’s main developer of the Semantic Desktop is of course aware of this problem, so he has been working hard to find a solution for the RDF storage part which is both up to the task in terms of performance and stability. This solution is Virtuoso, and Sebastian has now a working backend for Soprano (which is the Qt-style storage interface for Nepomuk). This means that the Redland or Sesame2 storage mechanisms for Nepomuk can now be replaced by the much faster Virtuoso store. For the user this has important advantages: faster search, tagging, rating and longer battery life on mobile devices.
So my project for tonight was: Switch the Nepomukserver on my development machine to Virtuoso. And apparently, I succeeded.

Here’s my quick walkthrough if you want to do the same:

  1. Download Virtuoso 5.0.12 or later here
  2. ./configure --prefix=/home/sebas/kdesvn/install (or whereever you install your KDE trunk)
    make -j3
    make install 
  3. install libiodbc2-dev (on Kubuntu or libiodbc-dev on Debian)
  4. rebuild kdesupport/soprano (possibly delete CMakeCache.txt),
    make sure Virtuoso backend is built

    -- Found iODBC 3.52.6: libs - /usr/lib/libiodbc.so; includes - /usr/include
    -- Performing Test __SOPRANO_HAVE_GCC_VISIBILITY
    -- Performing Test __SOPRANO_HAVE_GCC_VISIBILITY - Success
    -- Soprano Components that will be built:
       * Sesame2 storage backend (java-based)
       * Virtuoso storage backend (Run-time dependancy: Virtuoso)
       * Raptor RDF parser
         (including TriG parser)
       * The CLucene-based full-text search index library
       * D-Bus server/client support
    -- Soprano Components that will NOT be built:
       * Redland storage backend
       * Raptor RDF serializer
  5. Rebuild kdebase.
  6. Edit ~/.kde{4}/share/config/nepomukserverrc and put Soprano Backend=virtuosobackend ins the [Basic Settings] section. Mine looks like:

    [Basic Settings]
    Configured repositories=main
    Start Nepomuk=true
    Soprano Backend=virtuosobackend

    Obviously, the virtuosobackend line is the important one.

  7. That’s it for the setup. Now you need to restart the nepomukserver.

    // Check which backend we're currently using
    luna.sebas(~): qdbus org.kde.NepomukStorage /nepomukstorage org.kde.nepomuk.Storage.usedSopranoBackend                                                                                                                                                                                sesame2
    // Stop the nepomukserver
    luna.sebas(~): qdbus org.kde.NepomukServer /nepomukserver org.kde.NepomukServer.quit
    // Start the nepomukserver
    luna.sebas(~): nepomukserver
    // Make sure the Virtuoso backend is used
    luna.sebas(~): qdbus org.kde.NepomukStorage /nepomukstorage org.kde.nepomuk.Storage.usedSopranoBackend

    You’ll notice that it automatically starts converting your data from sesame2 (or possibly redland) format to the new Virtuoso format, this will show up as a job in your plasma notification area, and it might take a long time, depending on how much data you have. Go get a coffee now.

This worked for me. I was glad to find information on The Other Sebastian’s blog and on techbase.

Please leave a comment reporting your findings.

Interviewed about Project Silk, Qt DevDays

Koen Vervloesem has published (well, kind of published, it’s LWN subscriber-only right now, but AFAIK will become publicly available later) an interview with Frank “Social Desktop” Karlitschek and me. The interview provides a preview of what Frank and me will discuss in our respective presentations during NLUUG’s fall conference which will be held on October 29th in Ede, Netherlands. I heard that registration is still open, so if you happen to be in the area, drop by. For the majority of my readers (those that aren’t LWN subscribers and not able to come to “The Open Web” conference, this post is more turns out pretty useless though . As the interview was published on my birthday (I’m 33 now), I’ll just take that as an excuse. Random related fact: The KDE project is — to the day — exactly twenty years younger than I am. Happy birthday fellow gearheads!

Mostly unrelated fact, I’ve just returned from the Qt DevDays in Munich where I “hung out” with my fellow KDABians. A Dot (the KDE news site) story reporting about that is coming up (I’m about to queue it for review by fellow dot-editors).

Update: The Dot article has been published.

More Update: A Dutch version of the article is up on Transparante Zaken

La Divina Release Schedule

I went to the theatre tonight to see a modern interpretation of Dante Alighieri’s Divina Commedia. Parts of the play were rather beautiful, with singing and acrobat acts, the longer monologues I found rather … long. So let’s talk about KDE’s release schedule instead.

There are two interesting things to note. First, if you’re running KDE’s SVN trunk/, and you haven’t done it yet, upgrade your Qt to one of the pre-releases of Qt 4.6. Starting on Saturday, we’ll allow changes to trunk/ that require a Qt 4.6. There are two important reasons for requiring Qt 4.6:

  • Qt 4.6. has some rather nice new features. One of the more fancy news in 4.6 is the addition of Kinetic, the new animation framework in Qt. There are also rather huge improvements in QGraphicsView, so overall it’s well worth upgrading.
  • Qt 4.6 is essentially what people will use with KDE 4.4. Distros shouldn’t hold back shipping Qt 4.6 only because we didn’t test that extensively with our code base. So we (the release team) rather decided to require Qt 4.6 starting Saturday, so we’ll be able to weed out compatibility problems in our own code base and we can point our friends in Oslo to possible problems and thereby help releasing a rock-solid Qt.

For those not yet knowing all the Git commands and Qt’s path on Gitorious off their head, here‘s how you can track Qt:

git clone git://gitorious.org/+kde-developers/qt/kde-qt.git qt-kde

So requiring 4.6 is a good idea. The drawback is that this means that KDE cannot release 4.4 until Qt 4.6 is released (our policy is not to depend on unreleased versions). The Qties have promised to deliver on schedule, so we stretched ours a bit. This means that the next KDE release (4.4) will be two weeks later than initially planned, and out in February. In more detail it looks like this:

  • October 10th, 2009: Trunk depends on Qt 4.6
  • November 4th, 2009: Soft Feature Freeze
  • November 25th, 2009: Hard Feature Freeze
  • November 25th, 2009: Message Freeze.
  • November 25th, 2009: Tag KDE 4.4 Beta 1
  • December 1st, 2009: Release KDE 4.4 Beta 1
  • December 1st, 2009: Documentation/Handbook Freeze
  • December 16nd, 2009: Tag KDE 4.4 Beta 2
  • December 22th, 2009: Release KDE 4.4 Beta 2
  • Januari 5th, 2010: Artwork and Bindings Freeze
  • January 5th, 2010: Tag KDE 4.4 RC 1
  • January 6th, 2010: Release KDE 4.4 RC 1
  • January 19th, 2010: Tag KDE 4.4 RC 2
  • January 20th, 2010: Release KDE 4.4 RC 2
  • February 3rd, 2010: Tag KDE 4.4
  • February 9th, 2010: Release KDE 4.4

So you’ll still be able to install 4.4 for your dear before Valentine’s day and spread the Free Software love this way. Isn’t that divine?

Filelight rocks

One of my favourite utilities is filelight. Filelight helps you identify the big consumers in your filesystem, it can help you answer the question what’s eating your harddisk, and it does so very efficiently. Just today, I had, on my root partition, far too little free space. I knew I had quite some GB left, but got a disk full warning. First reaction: “WTF?!”, second reaction: fire up filelight to find the offender. Filelight quickly showed me that about one third of my root partition had vanished in /var/log, and in four files to be precise. A quick

echo -n > logfile.log

and hitting “rescan” on filelight showed the problem was solved. (Solved for now, I still need to check what made my logfiles blow up like this in only a matter of days. Filelight is one of those applications where I, as someone who tends to look very critical at software, just think “it’s finished”. It’s a small, rather self-contained utility that does one job very well: analyse space consumers on your filesystem. Thanks Max and Martin for bringing this wonderful utility onto my desktop. It’s a real pleasure to work with (of course the rainbow color mode is my favourite).