GCI 2014 and Grand Prize Trip

Many pre-university students have participated in Google Code-In (2014) again and for many of them it has been the first opportunity to make contributions to Free Software and Open Source projects. In opposite to Google Summer of Code the GCI program is organized as a worldwide contest where students at the age of 13-17 years take the challenge to complete as many software development tasks from their mentor organizations as possible.


Folder View panel popups are list views again

In later versions of Plasma 4, the Folder View widget adopted a special appearance when placed in a panel: It would arrange folder contents in a simple list instead of the usual icon grid. Folder View had to be rewritten completely for Plasma 5, and while there were various improvements along the way, the list view mode unfortunately went missing. Until now - on popular request, this feature will make a return soon in Plasma 5.4:


How to reference libTooling

Being accustomed to use of big frameworks like Qt, libraries like Boost, or smaller like OpenSSL it can be astonishing how difficult can be referencing external (but still native) library from C++ code.

All of libraries mentioned above come with fairly good CMake support making it more or less difficult to use after reading some (or all) of available documentation. With Clang we have two problems here:


Refactorings for KDevelop

I am going to implement some refactoring tools for KDevelop (GSoC 2015). After reading libTooling documentation (quite nice), some guides and reviewing some KDevelop/KDevPlatform/kdev-clang source code my ideas become more sharp. That's some of my thoughts.


Updates on Kate's Rust plugin, syntax highlighting and the Rust source MIME type

The other day I introduced a new Rust code completion plugin for Kate, powered by Phil Dawes' nifty Racer. Since then there's been a whole bunch of additional developments!

New location

Originally in a scratch repo of mine, the plugin has now moved into the Kate repository. That means the next Kate release will come with a Rust code completion plugin out of the box! (Though you'll still need to grab Racer yourself, at least until it finds its way into distributions.)

For now the plugin still works fine with the stable release of Kate, so if you don't want to build all of Kate from git, it's enough to run make install in addons/rustcompletion in your Kate build directory.

This also means the plugin is now on bugs.kde.org - product kate, component plugin-rustcompletion (handy pre-filled form link). And you can submit patches via ReviewBoard now.

New feature: Go to Definition

In addition to code completion popups, the plugin now also installs Go to Definition action (in the Edit menu, the context menu, and you can configure a keyboard shortcut for it as well). It will open the document containing the definition if needed, activate its view and place the cursor at the start of the definition.

Rust syntax highlighting now bundled with Frameworks

After brainstorming with upstream, we decided together that it's best for Rust and Kate users to deprecate the old rust-lang/kate-config repository and move the syntax highlighting file into KDE's KTextEditor library (the foundation of Kate, KDevelop and several other apps) for good, where it now resides among the many other rules files. With 1.0 out the door, Rust is now stable enough that delivering the highlighting rules via distro packages becomes feasible and compelling, and moving the development location avoids having to sync multiple copies of the file.

The full contribution history of the original repo has been replayed into ktexteditor.git, preserving the record of the Rust community's work. The license remains unchanged (MIT), and external contributions remain easy via ReviewBoard or bugs.kde.org.

KTextEditor is a part of KDE's Frameworks library set. The Frameworks do monthly maintenance releases, so keeping up with the Rust release cadence will be easy, should the rules need to be amended.

It's a MIME type: text/rust

Kate plugins and syntax highlighting files preferably establish document identity by MIME type, as do many other Linux desktop applications. The desktop community therefore maintains a common database in the shared-mine-info project. With the inclusion of a patch of mine on May 18th, shared-mime-info now recognizes the text/rust type for files matching a *.rs glob pattern.

If you're searching, opening or serving Rust source files, you should be using text/rust from now on.

That's it for today! I still have a bunch of improvements to the plugin planned, so stay tuned for future updates.


Basic code completion for Rust in KDE's Kate (and later KDevelop)

A few days ago the Rust community announced v1.0 of their new systems programming language, Rust. Having followed the project for some time and finally having used the language for a number of small projects this year, I've come to feel that using Rust is interesting, fun and productive. I'd like to highly encourage everyone to give it a look now that it's finally considered ready for prime time.

To aid the effort I've put some Sunday hacking time into a basic Rust code completion plugin for Kate today. It's built around Phil Dawes' very nifty Racer, freeing it up to concern itself only with exposing some configuration and getting data provided by Racer into Kate. Not difficult at all.

This is what it looks like in action:

The Rust code completion plugin for Kate


The plugin is very basic at the time of writing (which is minutes after getting things working, this Sunday is running out!). The mapping of completion match metadata to Kate's format (from fundamentals like the match type, to more complex features like smart grouping) can likely be improved still. Ditto for auto-completion behavior (i.e. defining the circumstances in which the completion popup will kick in automatically, as opposed to waiting for manual invocation) and simply performance.

The plugin also doesn't work in KDevelop 5 yet, although that one's on KDevelop -- it doesn't support the KTextEditor plugin type present in Frameworks 5 yet. I'm told the KDevelop team has addressing this on their agenda.

Syntax highlighting

Both KDE and Rust implement the AwesomeCommunity trait. The Rust community in particular maintains an official Kate syntax highlighting file here. The repository for the Kate plugin includes this as a submodule and installs it by default; if you'd like it not to do that, there's a build system toggle to disable it. Update: With the move of the plugin source (see below), this is currently no longer the case, but the upstream repo now has install instructions!

A MIME type for Rust source code

While the plugin will run for all *.rs files, Kate/KDevelop plugins and syntax highlighting files preferably identify documents by their MIME type. It turns out there isn't a MIME type for Rust source code in shared-mime-info yet, so I've started the process of getting one in. (Update: Merged, along with this and this!)

Getting the plugin

The plugin is currently still hosted in a personal scratch repo of mine, on git.kde.org. You can browse the source , or skip straight to this clone URL:


This location might change if/when the plugin is promoted to proper project status; I'll update the post should that happen. I've included some install instructions that go over requirements, options and configuration. Note that you need a Rust source tree to get this working. Check them out!

Update: As of May 20th 2015, the plugin is now bundled with Kate in its repository (browse), to be included in the next Kate release. You can get it by building Kate from git as whole, or you can do make install in just the plugin's subdir of your build dir; at this time it works fine with Kate's last stable release. Given all this, I'll only quickly recap some additional info for getting it working here: Once you've enabled the Rust code completion item in the plugin page, a new page will appear in your Kate config dialog. Within are config knobs for the command to run Racer (which you'll therefore need an install of) and the path to a Rust source tree (which you can of course grab here), which Racer needs to do its job. Make sure both are set correctly, and then start editing!

Getting in touch

If you have any comments or requests and the blog won't do (say, you have a cool patch for me), you can find my mail address inside the AUTHORS file included in the repository. Signing up for KDE.org's proper bug tracking and patch submission pathways is still pending :-). Update: After the move to Kate's repository (see above), you can now file bugs and wishes against the plugin via the plugin-rustcompletion component of the kate product on our bugtracker (handy pre-filled form link). You can also submit patches via ReviewBoard now.


Simple Qt container optimization you should do on your code

Most of us know we shouldn't let our containers detach. QList, QVector, QString, etc. are implicitly shared. Copying them is cheap, but when we call a non const member function it will detach and trigger a deep copy.

This is common knowledge, but we still forget and do:
Item item = fetchJob->items().first();
instead of:
Item item = fetchJob->items().at(0);


Moving desktop widgets without the handle

Moving a widget in Plasma Desktop 5.3 in press-and-hold mode
Getting a move on (notice the mouse pointer)

In Plasma Desktop 5.3 (released today), the desktop configuration dialog offers a new experimental tweak: A mode in which widgets can be dragged around by pressing and holding anywhere on the widget. When enabled, the widget handle is also no longer shown just on hover, but only after a press and hold.

The goal of this mode is to make widget handling feel more natural and spatial, and faster. Instead of having to aim for a widget to reveal the handle, and then go after the handle in a second step, you can just grab on to it anywhere. Easy.

The immediate challenge with this setup is discoverability. To address this problem, unlocking widgets in this mode displays a notification bubble introducing the interaction pattern (which can be easily dismissed forever with the action button):

Press-and-hold notification bubble on widget unlock
"It looks like you're moving a widget"

Press-and-hold widget handling is not yet the default in 5.3 (you can enable it on the Tweaks config page of both the Desktop and Folder View containments). Beta feedback has been positive so far, but changes to the interaction vocab of our shell components shan't be done lightly—using press-and-hold for widget handling means withholding the verb from widgets themselves, which is something we have to negotiate with widget authors. We think the joy felt when using this pattern and its widespread adoption in other home screen UIs bode well for it, however. Let us know how you feel!


Building on new pillars: Activities and KPeople in Plasma 5.3

With the release of Plasma 5.3 only days away, it's time to start talking about some of the new features users of Plasma Desktop will get their hands on in the new version.


Many Plasma Desktop users are already familiar with Activities as a toolbox to divide and organize their personal computing environment into shards: You can set up and name activities, distribute application windows across them, associate relevant files with them, switch between, start and stop them to your heart's content.

A previously less explored side to the Activities story is what the technology can offer while working inside any one of your activities - thus even if you don't bother with setting up more than one and just stick to the default activity created for you the first time you log into Plasma.

This changes with Plasma 5.3! New work to make it easier for applications to enter useful data into the activity's knowledge store, as well as run smart queries against it, enable some new and improved functionality in both the Application Menu and Task Manager widgets in this release.

In Application Menu, all of the Recent categories (one of which is new) are now powered by Activities. One immediate advantage of this is that their contents now change with the activity you're in, but as promised it also provides several other inherent benefits:

The three Recent categories in Application Menu 5.3
The three Recent categories in Application Menu 5.3

  • Recent Applications used to be only aware of applications launched through Application Menu itself. With launch info now retrieved from the Activities knowledge store and all other launchers (for example KRunner, but also just opening a document from Dolphin is a launch) free to enter data there, this submenu can now gather much more recent system activity in one place. Furthermore, new data sources can be added as time goes on without having to touch Application Menu itself.
  • Recent Documents benefits in a similar way. Over the older KRecentDocument framework used before, the Activities backend offers access to a longer, richer backlog of document use data. User control over the data is also enhanced - it's now possible to forget about individual documents from the context menu, instead of being forced into a complete wipe.
    But that's not all on the documents front! Activities enable both Application Menu and Task Manager to easily query for recent documents by the application they were opened in, leading to lists of recent docs in the context menus of various types of application launcher buttons:

    Per-application recent documents in Application Menu and Task Manager 5.3
    Per-application recent documents in Application Menu and Task Manager 5.3

  • Recent Contacts is a brand new addition to Application Menu 5.3 showing the people you've been in touch with recently, along with their realtime status information. The first part of this is handled through Activities; dealing in people data, however, is facilitated by a recent addition to KDE Frameworks 5: KPeople.


Application Menu's Recent Contacts category in Plasma 5.3
Recent Contacts in Application Menu 5.3: Powered by Activities and KPeople

The KPeople framework allows applications (including the shell) to retrieve lists of people and information about them (status, contact metadata), as well as perform actions on them - e.g. initiate a chat, as used by Application Menu when you click on an entry in the Recent Contacts category.

The data backing this interface is provided by backend plugins. The first implementer of a fully-featured KPeople backend is of course our very own Telepathy instant messenging suite. In the future, other KDE communication apps will integrate with KPeople, making conversations had e.g. in KDE's IRC client Konversation pop up in Application Menu as well.

Closing thoughts

Both the enhanced Activities backend and KPeople are very fresh. While we work hard to line up everything behind them (implement additional data sources and optimize those implementations, for example), they are still exposed somewhat carefully in Plasma Desktop 5.3. The Recent Contacts category in Application Menu, for example, is disabled in this release by default, because a Telepathy release entering conversation data into the Activities knowledge store is still pending. It can be enabled from the widget's config dialog.

In future releases you can expect us to make more of these pillars as our confidence grows, with additional UI functionality built on them and more prominent placements of it in various areas of the shell. Lots of work ahead!


PyKDE Future: Seeking a New Maintainer

For anyone who has been paying any attention of PyKDE5 over the last year or so, it is no secret that development and maintenance has been at a standstill. I've been very busy with a family and small children, and that eats time like you wouldn't believe. (Unit number 2 is almost 6 months now, healthy and happy I can report.) But another important factor is that my interests have shifted towards web related technologies over the last few years.

So, it is time to put the call out for a new maintainer or maintainers. I would also like to put in a bit of an apology to anyone who has depended on PyKDE5 and has had to put up this wishy-washy state of limbo for the project. And I would also like the thank people for the occassional drive-by commit which has helped keep the existing functionality mostly working.

Anyone interested should contact me. I'm willing to help and advise anyone who wants to learn the ropes, and to facilitate a transition to new management. If you are interested and curious but don't want to stick your hand up immediately and commit yourself, then still email me and I can forward on some information to you which may help explain how PyKDE5 works and is updated. It should give you an idea of the task at hand.