Skip to content

Welcome to Planet KDE

This is a feed aggregator that collects what the contributors to the KDE community are writing on their respective blogs, in different languages

Saturday, 23 October 2021

Since decades KDE’s translation and localization framework KI18n provides a mechanism for marking strings for message extraction and deferred translation, the I18N_NOOP prepprocessor macros. Those can be very error prone though, so for KDE Frameworks 5.89 there is now a proposed replacement.

Translation macros

The I18N_NOOP macro differs from the more widely used i18n() function calls in that it only causes a message to be extracted for translation, but it doesn’t actually perform the translation. This is useful when the translation isn’t possible yet at this point or when there are many possible messages of which only very few are actually needed at runtime. Therefore those macros often appear in static message tables.

This isn’t unique to KI18n, Qt’s translation system has similar macros for example (QT_TR_NOOP etc).

And while this isn’t too bad for a single message, there are many more cases to consider, such as any possible combinations of:

  • Quantified messages, ie. singular/plural support.
  • Messages needing a translation context for disambiguation.
  • Messages containing Kuit markup.

That’s where the macros hit their limits. There we have more than one argument to pass to the runtime translation call, so what would a macro map to? And do we trust the developer to manually carry the context string? (see e.g. I18NC_NOOP vs. I18N_NOOP2)

It gets harder and harder to use this correctly the more variants we need to consider, so Albert rightfully wasn’t too happy when I recently proposed plural variants of those macros.

So what can we do instead?


KI18n has another mechanism for deferred translation, KLocalizedString and the various ki18n() construction functions for it. Unlike the macro approach you cannot accidentally disassociate the various strings making up a message with this, it’s all tied together by a single object. Still you can control the time when the actual translation happens, so creating KLocalizedStringinstances can happen very early in the program flow.

There’s a downside though, creating a KLocalizedString isn’t exactly cheap, it involves memory allocations and deep copies of the strings. That isn’t a big problem for individual messages, but it does hurt if you are dealing with larger message tables, with many entries that might never actually be needed during a program run. The macros avoided those costs.


We can have the best of both worlds though! The macro solution goes back to the C++98 days, and might have been the best we could do at the time, but things have changed.

And that’s where the new KLazyLocalizedString comes in. It’s a simple constexpr container for string literals needed for translations, and as such can be stored in static data tables. At runtime there’s only one meaningful thing to do with it, converting it to a KLocalizedString when needed.

Similar to KLocalizedString, KLazyLocalizedString has its own set of construction functions, kli18n(). Unlike their runtime counter-parts those enforce the use of string literals. That is necessary anyway for message extraction to work, and it avoids having to deal with runtime memory issues at all here.

Migrating away from I18N_NOOP

Let’s look at the following example which illustrates a typical use-case for the I18N_NOOP macro, a static table containing among other things a message that should be translated at runtime.

struct {
    MyClass::VehicleType type;
    const char *name;
} static constexpr const vehicle_msg_table[] = {
    { MyClass::Train, I18N_NOOP("Train") },
    { MyClass::Bus,   I18N_NOOP("Bus") },


const auto it = std::find_if(std::begin(vehicle_msg_table), std::end(vehicle_msg_table), [vehicleType](const auto &m) {
    return m.type == vehicleType;
QString translatedMessage = i18n(*;

Ported to KLazyLocalizedString this looks very similar:

struct {
    MyClass::VehicleType type;
    KLazyLocalizedString name;
} static constexpr const vehicle_msg_table[] = {
    { MyClass::Train, kli18n("Train") },
    { MyClass::Bus,   kli18n("Bus") },


const auto it = std::find_if(std::begin(vehicle_msg_table), std::end(vehicle_msg_table), [vehicleType](const auto &m) {
    return m.type == vehicleType;
QString translatedMessage = KLocalizedString(*;

This is now no longer constrained to using the same kli18n() variant in every entry though, we could change the second entry to include a context for example, without having to worry about this when consuming the table entries later:

    { MyClass::Bus,   kli18nc("the vehicle, not the USB one", "Bus") },

It’s also possible to have plural texts in a static message table, the API docs in the merge request contains an example illustrating that.


At this point this is still in review and scheduled for KDE Frameworks 5.89 which is due to be released early January. The old macros would be deprecated at the same time, so we’ll have a bit of porting ahead of us there.

Two big features landed this week: support for fingerprint readers and the NVIDIA driver’s GBM backend!

Fingerprint support has been in progress for quite some time thanks to Devin Lin, and this week, it was merged for Plasma 5.24! So far we let you enroll and de-enroll fingers, and any of those fingers can be used to to unlock the screen, provide authentication when an app asks for your password, and also authenticate sudo on the command line! It’s really cool stuff.

That’s not all: Xaver Hugl merged preliminary support for the proprietary NVIDIA driver’s GBM backend for Plasma 5.23.2! Overall this should improve the experience for NVIDIA users in many ways, both now, and also over time.

In addition, a truly titanic number of bugfixes were made this week. We have now addressed most of the issues people have found with Plasma 5.23! Here are the remaining ones which are confirmed and don’t have active work to fix them. Working on these would be a great way for any developers reading along to make a big difference quickly!

Even More New Features

Spectacle now lets you configure it to remember the last-used capture mode for its automatically taken-screenshot on launch, or even to take no screenshot at all (Antonio Prcela, Spectacle 21.12):

In Discover, You can now enable, disable, and remove Flatpak repos, and also enable and disable distro repos (Aleix Pol Gonzalez, Plasma 5.24)

Bugfixes & Performance Improvements

Okular’s quick annotations toolbar button now opens the full annotations toolbar when for some reason there are no quick annotations configured (Bharadwaj Raju, Okular 21.08.3)

Fixed a 5.23 regression that could cause Plasma to crash on launch when logging in (Noah Davis, Plasma 5.23.1)

On multi-screen systems, full-screen overlays such as the Screen Locker, Logout Screen, and image view in Telegram once again open on the correct screen rather than all appearing on top of each other in a big jumbled heap (lol) (Vlad Zahorodnii, Plasma 5.23.1)

The Kicker Application Menu once again displays System Settings pages when searching (Alexander Lohnau, Plasma 5.23.1)

Setting an accent color while using a color scheme that doesn’t have header colors (such as Breeze Classic) no longer inappropriately applies a small number of header colors to the color scheme, which would break it in creative ways (me: Nate Graham, Plasma 5.23.1)

Checkboxes in Discover’s settings page now look unchecked when you uncheck them, and vice versa (lol) (Aleix Pol Gonzalez, Plasma 5.23.1)

When an app is playing audio on a virtual desktop that is not the active one, now its Task Manager tooltip can still be used to interact with it using the inline media controls (Fushan Wen, Plasma 5.23.1)

Clearing emoji history in the Emoji Selector window now actually works (me: Nate Graham, Plasma 5.23.1)

The F10 keyboard shortcut once again works to create a folder on the desktop (Derek Christ, Plasma 5.23.2)

When the Desktop context menu is showing both the “Delete” and “Add to Trash” actions (because both are enabled in Dolphin, as it context menu gets synced with the desktop context menu), both once again work (Fabio Bas, Plasma 5.23.2)

The Shift+Delete shortcut to permanently delete items on the desktop once again works (Alexander Lohnau, Plasma 5.23.2)

In the Plasma Wayland session, System Settings’ touchpad page now correctly shows options for how you can right-click (Julius Zint, Plasma 5.23.2)

On certain distros (such as Fedora), when you install an app with Discover, you can now remove it immediately without having to quit and restart Discover first (Aleix Pol Gonzalez, Plasma 5.23.2)

Discover’s Install buttons once again look correct for people with Plasma 5.23 and Frameworks 5.86, but not 5.87 (Aleix Pol Gonzalez, Plasma 5.23.2)

Plasma now internally ignores the dummy placeholder screen that Qt sometimes creates, which should help with multi-monitor problems related to panels and wallpapers being switched around or going missing (David Edmundson, Plasma 5.23.2)

Search fields throughout Plasma now work properly when you type text using a virtual keyboard (Arjen Hiemstra, Plasma 5.23.2)

The Plasma applet config window is now able to avoid being cut off on a 1024×768 screen resolution with a bottom panel (me: Nate Graham, Plasma 5.23.2)

Discover can now detect when a locally-downloaded package you’ve asked it to open is already installed, so it will show you the option to remove it, rather than letting you try and fail to install it again (Aleix Pol Gonzalez, Plasma 5.23.2)

Kickoff’s new “Keep open” feature now continues to keep the popup open if you use it to open or launch anything, and it no longer continues to show apps in the main view from the last-highlighted category when you hover the cursor over the “Help Center” item in the sidebar (Eugene Popov, Plasma 5.23.2)

In the Plasma Wayland session, using the hidden “BorderlessMaximizedWindows” setting no longer causes maximized windows to stop responding to mouse and keyboard events (Andrey Butirsky, Plasma 5.23.2)

It is once again possible to change the resolution when running in a VM (Ilya Pominov, Plasma 5.24)

In the Plasma Wayland session, idle time detection (e.g for determining when to lock the screen to put the computer to sleep) now works more properly (Vlad Zahorodnii, Plasma 5.24)

Right-clicking on a Task Manager task to display its recent files no longer freezes Plasma when any of those files lives on a slow or inaccessible network location (Fushan Wen, Plasma 5.24)

The free space notifier no longer pointlessly monitors read-only volumes (Andrey Butirsky, Plasma 5.24)

Attempting to share something via email when the system has no email client apps installed no longer crashes the app used to initiate the action (Aleix Pol Gonzalez, Frameworks 5.88)

QtQuick-based apps now display the correct visual appearance for disabled checkboxes (Aleix Pol Gonzalez, Frameworks 5.88)

System Tray applets that use the expandable list item paradigm now, finally, totally, completely display the expanded view with the correct highlight height, taking into consideration the user’s font size and any disabled invisible items and also hopefully cosmic rays and swamp gas (me: Nate Graham, Frameworks 5.88)

The Command Bar in many apps no longer ever displays any actions that lack text and also displays actions in alphabetical order now (Eugene Popov, Frameworks 5.88)

The whole system is now faster to access files when your system’s /etc/fstab file happens to have entries identified with UUID and/or LABEL properties (Ahmad Samir, Frameworks 5.88)

User Interface Improvements

The new Overview effect now has a blurred background by default (it’s configurable), and also shows you a strip along the top that lets you remove, rename, or add more Virtual Desktops! (Vlad Zahorodnii, Plasma 5.24):


Changing the color scheme now toggles the standardized FreeDesktop light/dark color scheme preference, so 3rd-party apps that respect this preference will be able to automatically switch to light or dark mode based the lightness or darkness of your chosen color scheme. Isn’t that incredibly cool!? (Nicolas Fella and Bharadwaj Raju, Plasma 5.24)

The Lock screen now exposes the Sleep and Hibernate actions, (when supported) (Vlad Zahorodnii, Plasma 5.24):

Obvious question is obvious: “Now when are you going to add Shut Down and Restart Actions!?!?!!” Answer: soon 🙂

The global edit mode toolbar now offers you a way to configure your screens, replacing the button to show the activity switcher (me: Nate Graham, Plasma 5.24):

The Emoji Selector window’s “Recent Emojis” sidebar item can now be accessed when empty, and shows a placeholder message in this case (me: Nate Graham, Plasma 5.24)

The “Send to Device” and “Send via Bluetooth” windows now set a sensible title, use more standard styling for their buttons, and the “Send” button is only enabled when there’s a device to send to (me: Nate Graham, Frameworks 5.88):

The color picker applet’s popup can now be closed using the Escape key (Ivan Tkachenko, Plasma 5.24)

…And everything else

Keep in mind that this blog only covers the tip of the iceberg! This week it was quite a big tip, but the whole iceberg is still much bigger. Tons of KDE apps whose development I don’t have time to follow aren’t represented here, and I also don’t mention backend refactoring, improved test coverage, and other changes that are generally not user-facing. If you’re hungry for more, check out, where you can find blog posts by other KDE contributors detailing the work they’re doing.

How You Can Help

Have a look at to discover ways to be part of a project that really matters. Each contributor makes a huge difference in KDE; you are not a number or a cog in a machine! You don’t have to already be a programmer, either. I wasn’t when I got started. Try it, you’ll like it! We don’t bite!

Finally, consider making a tax-deductible donation to the KDE e.V. foundation.

Friday, 22 October 2021

Let’s go for my web review for the week 2021-42.

Facebook Plans to Rebrand Company With New Name, Verge Says

Tags: tech, facebook, business

Lipstick on a pig as they say. :-)

Software Freedom Conservancy files lawsuit against California TV manufacturer Vizio Inc. for GPL violations

Tags: legal, free-software, compliance

Important lawsuit, let’s hope it goes through.

Jira: Razor Blades?

Tags: tech, agile, jira

With the amount of time I spent with this particular beast I have to agree. It can be used well of course, but it’s designed in a way that makes it very hard to use properly at all.

How to win at CORS -

Tags: tech, http, cors

Very extensive post about CORS. This is fairly complete and shows how quickly it can become complicated.

Hexagonal Architecture in Java Simplified

Tags: tech, java, architecture

Simple illustration of that software architecture pattern in Java

ELF dynamic linking: a brief introduction

Tags: tech, linking, elf

Very nice introduction on the topic. This is a recommended read.

pyinstrument - pyinstrument 4.0.4 documentation

Tags: tech, python, profiling

Another profiler for Python which looks interesting.

Python stands to lose its GIL, and gain a lot of speed | InfoWorld

Tags: tech, python, multithreading

This could be a game changer for a future Python 4.

Tests aren’t enough: Case study after adding type hints to urllib3 —

Tags: tech, python, type-systems, mypy

This explains quite well why I liked to have type information in my code bases. This also shows a few interesting bits of mypy use.

Simple Product Management Tricks - Jacob Kaplan-Moss

Tags: product-management, automation

Interesting tips for musing a bit in product management. I especially like the tip about playbooks instead of automation.

How to get useful answers to your questions

Tags: product-management, requirements

Very important skill indeed…

Bye for now!

Stay in the loop: If you want to help me make these videos: Patreon: Youtube: Paypal: My website is and if you want to contact me, my telegram handle is [at] veggero.

code snippetsThese are some really cool or obfuscated code snippets for your amusement. We didn’t want to rate them, so the order doesn’t mean anything at all 🙂

Just to make sure that there’s no misunderstanding: This code really is/was in the Qt or KDE repositories.

From Kivio, main.cpp

  if (!app.start()) {
      delete splash;
      return 1;
  delete splash;

From Qt 2.2.1 (src/canvas/qcanvas.cpp)

static int gcd(int a, int b)
  // ### Should use good method, but not speed critical.
  int r = QMIN(a,b);
  while ( a%r || b%r )
  return r;

Writing code that builds from Qt 1 and Qt 2 (not from KDE developers . . .)

if (!strncmp((LPCSTR)Destination
#ifdef QT_20
    , "file:", 5))
    GoItem((LPCSTR) Destination
#ifdef QT_20
        + 5);

Found in koffice/filters/kocrypt/, not really code, but still funny

// OK. Get this. I'm not going to add 4 lines of code to this thing and
// nest it in another [infinite] loop just so someone can feel warm and
// fuzzy because they found a complicated way to avoid using a perfectly
// fine goto. This is my code and I like the goto just the way it is.
// Deal with it.

Found in qt/src/gui/kernel/qlayoutengine.cpp – also “just” a comment

Do a trial distribution and calculate how much it is off.
If there are more deficit pixels than surplus pixels, give
the minimum size items what they need, and repeat.
Otherwise give to the maximum size items, and repeat.

I have a wonderful mathematical proof for the correctness
of this principle, but unfortunately this comment is too
small to contain it.

From qt/plugins/src/imageformats/jpeg (3.0 beta 4)

if ( name.lower() != "JPEG" )

From kdebase/kate/view/kateviewdialog.cpp (KDE 2.2) (m_search is a QComboBox)

((QLineEdit *) (m_search->children()->getFirst()))->selectAll();

From koffice/kspread/ (KOffice 1.1), trying to save a date


From Qt 3’s qlabel.cpp

void QLabel::buddyDied() // I can't remember if I cried.

From kdepim/messageviewer/objecttreeparser.h until the end of KDE 4

* The origin and purpose of this function is unknown, the ancient wisdom about it got lost during
* the centuries.
* Historicans believe that the intent of the function is to return the raw body of the mail,
* i.e. no charset decoding has been done yet. Sometimes CTE decoding has been done, sometimes
* not. For encrypted parts, this returns the content of the decrypted part. For a mail with
* multiple MIME parts, the results are conecated together. Not all parts are included in this.
* Although conecating multiple undecoded body parts with potentially different CTEs together might
* not seem to make any sense in these modern times, it is assumed that initially this function
* performed quite well, but the ancient scrolls got damaged with the ravages of time
* and were re-written multiple times.
* Do not use. Use plainTextContent() and htmlContent() instead.
MESSAGEVIEWER_DEPRECATED_EXPORT QByteArray rawDecryptedBody() const<br>

And finally, found in KDAB’s very own GammaRay (from

static HitMeBabyOneMoreTime britney;

Happy Halloween, folks.

About KDAB

If you like this article and want to read similar material, consider subscribing via our RSS feed.

Subscribe to KDAB TV for similar informative short video content.

KDAB provides market leading software consulting and development services and training in Qt, C++ and 3D/OpenGL. Contact us.

The post Fun and Scary Code from Qt and KDE appeared first on KDAB.

Last Saturday we had an improvised NeoChat mini development sprint in a small hotel room in Berlin in the occasion of the 25th anniversary of KDE. In a good KDE tradition, Carl spent this time on improving NeoChat settings. He ported both the NeoChat general settings and the specific room settings to the new Kirigami.CategorizedSetting component. Tobias fixed a lot of papercuts and now the power level should be fetched correctly, we show the number of joined users instead of joined+invited users in the room information pane, the user search is now case insensitive. Nicolas focused on fixing our Android build by making the spellchecking feature compile on Android.

Roon settings
Roon settings

General settings
General settings


Aside from the mini-sprint, we also made a few more improvements during the week. Tobias fixed the flicking of the timeline on mobile and Carl made it possible for the user to resize the room information drawer.

Thursday, 21 October 2021

on the Firefox Add-ons page.

Dead Konqi sitting on the Earth
Konqi is somewhat impaired today.

A fix is being worked on, but might take a bit, sorry about that.

Stay in the loop: If you want to help me make these videos: Patreon: Youtube: Paypal: My website is and if you want to contact me, my telegram handle is [at] veggero.

Every now and again users would ask for a macOS version of Kdenlive. Up until recently, the only thing we were able to offer was a very, very old MacPorts version (0.9.10).

But, after Vincent and I invested some time in it, we are happy to announce that we now have an up-to-date nightly build for macOS! However, since Kdenlive is a complex application with many dependencies, it still needs some testing before we can call it officially stable.

And that’s where you come in: If you are a Mac user, please consider downloading the nightly macOS version and testing it!

Download and test

Note that, when running this version of Kdenlive on macOS, you may get an “unidentified developer” warning. You can still open the app by following the instructions on Apple’s support page. the Apple’s support page.

Report issues

Please report any bugs you come across either to, or on GitLab issue #993. In your report, please remember to mention the number of the build you are testing. Also, keep in mind the general bug report conventions.

Known issues
  • By default the mac style is used instead of the dark breeze style which recommended for Kdenlive (you can change the style in the settings menu)
  • The layout switcher is not visible since a native menu bar is used on mac. You can still switch the layout from the view menu (BUG 441033)

Technical background

If you follow the Kdenlive project closely, you will remember that in the first video cafe we talked about macOS and that a big blocker was that DBus caused trouble with the dmg packaging. DBus is used for the communication between the render process and the application’s main window.

Vincent made it possible to build Kdenlive with the cmake flag -DNODBUS=ON. When you use this flag, Kdenlive uses QLocalSocket and QLocalServer for communication instead of DBus.

KDE Craft LogoOnce the DBus issue was solved, there were only some small issues left to fix. To build Kdenlive on macOS, we use KDE Craft, a meta-build system and package manager that we have already been using for some time for our Windows builds.

The main job after was to adjust the so-called “blueprints”, and tweak some parts of the Kdenlive code to use the right file paths to find all the plugins. It took a while to find and fix all these small issues, and the last one we were aware of was that the frei0r effects were missing.

This last problem has now been solved.

Related code changes

Note: these are only some of the most important changes


KDE Craft Blueprints

  • Kdenlive master allows to avoid dbus Commit
  • Kdenlive beginning to work on Mac (in DMG) Commit
  • Kdenlive: fix finding frei0r, skip kf5filemetadata Commit
  • MLT: relocatable build (Linux/MacOS) Commit


  • Allow to use QLocalSocket/Server instead of DBus Commit
  • Fin MLT on macOS Commit
  • Fix install location on macOS Commit
  • Use .rcc icons on macOS too Commit


  • CMake: fix MacOS build and allow relocatable build Commit

In the last week, KDE released version 5.23 – 25th Anniversary Edition – of the Plasma desktop with the usual long list of updates and improvements. This release celebrates 25 years of KDE, and Plasma 5.23.0 was released right on the day 25 years ago Matthias Ettrich sent an email to the de.comp.os.linux.misc newsgroup explaining a project he was working on. And Plasma 5.23 (with the bug fix 5.23.1) is now available for all Debian releases. (And don’t forget KDE Gears/Apps 21.08!)

As usual, I am providing packages via my OBS builds. If you have used my packages till now, then you only need to change the plasma522 line to read plasma523. To give full details, I repeat (and update) instructions for all here: First of all, you need to add my OBS key say in /etc/apt/trusted.gpg.d/obs-npreining.asc and add a file /etc/apt/sources.lists.d/obs-npreining-kde.list, containing the following lines, replacing the DISTRIBUTION part with one of Debian_11 (for Bullseye), Debian_Testing, or Debian_Unstable:

deb ./
deb ./
deb ./
deb ./
deb ./

The sharp eye might have detected also the apps2108 line, yes the KDE Gear suite of packages hgas been updated to 21.08 some time ago and is also available in my OBS builds (and in Debian/experimental).

Uploads to Debian

Plasma 5.23.0 has been uploaded to Debian, and is currently in transition to testing. Due to incorrect/insufficient Break/Depends, currently Debian/testing with the official packages for Plasma are broken. And as it looks this situation will continue for considerable time, considering that kwin is blocked by mesa, which in turn is blocked by llvm-toolchain-12, which has quite some RC bugs preventing it from transitioning. What a bad coincidence.

KDE Gears 21.08 are all in Debian Unstable and Testing, so the repositories here are mostly for users of Debian Bullseye (stable).

Krita beta

Krita has released the second beta of Krita 5.0, and this is available from the krita-beta repository, but only for amd64 architectures. Just add

deb ./

Enjoy the new Plasma!