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

Monday, 25 October 2021

What makes a great team? One important factor is that you have a balanced set of skills and personalities in the team. A team which only consists of leaders won't get much work done. A team which only consists of workers will not work into the right direction. So how can you identify the right balance and combination of people?

One answer is the Team Member Profile Test. It's a set of questions which team members answer. They are evaluated to give a result indicating which type of team member the person is and where it lies in the spectrum of possible types.

There are two dimension which are considered there, how much team members are oriented towards tasks and how much they are oriented towards people. This can be visualized in a Results Chart.

Here is an example:

You can see five segments:

  • The center (5,5) is the "worker" who has a set of balanced of attributes, no extremes. These team members are extremely important because they tend to just get stuff done.
  • The top left (9,1) is the "expert" who is focused on the task and its details but doesn't consider people that much. You need these to get the depth of work which is necessary to create great results.
  • The bottom right (1,9) is the "facilitator" who is something like the soul of the team, focused on social interactions and supports the team in creating great results.
  • The top right (9,9) is the "leader" who is strong on task and people and is giving direction to the team. You need these but you don't want to have more than one or two in a team otherwise there are conflicts of leadership.
  • The bottom left (1,1) is the "submarine" who floats along and tries to stay invisible. Not strong on any account. You don't want these in your team.

The test can provide some insight into the balance of the team. You want to have all but the submarine covered with an emphasis on the workers.

How does your team look like on this diagram?


 

https://phabricator.kde.org/source/latte-dock/

Let's welcome Latte Dock v0.10.3 the 3rd Official Bug Fix Release of v0.10.x branch!
 
Go get it from, download.kde.org*

Fixes

  • support GlobalScale in combination with PLASMA_USE_QT_SCALING properly under X11 environment
  • add CornerMargin option for latte and plasma indicators and expose it through the indicators api for all the indicators to use
  • unblock visibility mode properly when Meta key is used to show an application launcher such as Win11, Simple menu etc.
  • fix focus behavior when applets are requesting input such as knotes applet
  • expose indicators iconOffsetX/Y value to applets
  • enable/disable "CanBeAboveFullscreenWindows" option properly
  • disable GtkFrameExtents for docks and panels that ByPassWindowManager ("CanBeAboveFullscreenWindows" option) under X11
  • draw always a contrasted border for latte indicator
  • simplify latte indicator implementation
  • enforce RoundToIconSize for all applets always and as such the Items Size is always respected. If the user has blur issues with its icons, he should specify an item size which is present at the icon theme. For example, 16px., 24px., 36px., 48px.
  • identify kickofflegacy applet properly
  • fix popup positioning for plasma-style popups when the dock background is using very big corner roundness
  • prevent session manager from restoring latte just like Spectacle is already doing
  • respect virtual desktops navigation wrapping around option
  • expose translations for default dock and panel templates


Corner Margin

- corner margin is drawn in purple -
With Latte 0.10.3 indicators gained the ability to specify the background corner margin. This is totally on indicator responsibility to expose or adjust properly and that is the case for Latte and Plasma Indicators that expose it from their settings. With this setting the user is now able to move tasks and applets inside the corner of backgrounds with very big roundness.
 


- corner margin option in latte indicator -
It was decided that the option should be part of the indicators api because it is on indicators responsibility to specify how much of the area provided to them, it is actually painted. If an indicator is not touching corner margin at all then default latte behavior is used which is playing safe by taking as granted that indicator is painting the entire area provided to it all the time.

 

Donations

You can find Latte at Liberapay,     Donate using Liberapay


or you can split your donation between my active projects in kde store.
-----
 
* archive has been signed with gpg key: 325E 97C3 2E60 1F5D 4EAD CF3A 5599 9050 A2D9 110E

 

QML is a nice technology but it sometimes feels that some parts of KDE Frameworks aren’t neatly integrated with it. For example, until recently KNotification didn’t have QML bindings, which was the same for KSyntaxHighlighting. Thankfully Volker Krause took care of both.

Another part of the often-used KDE Frameworks but had missing QML bindings was Sonnet. Sonnet is a very nice KDE framework powering KDE text areas with spell checking.

The good news, Sonnet will, in the next KF5 release, supports QML apps too!

Spell checking in NeoChat
Spell checking in NeoChat

There are two ways to add Sonnet supports in your application.

The easy way: Kirigami and qqc2-desktop-theme integration

If you use Kirigami and are fine with the default behavior, this only needs one single line in your QtQuick.Controls.TextArea.

import org.kde.kirigami 2.18 as Kirigami
import QtQuick.Controls 2.15 as QQC2

QQC2.TextArea {
    Kirigami.SpellChecking.enabled: true
}

This line is just a hint for the QtQuick Controls 2 theme to enable spell checking for this TextArea. Currently, only the qqc2-desktop-theme uses this hint. For other themes, like qqc2-breeze-style or custom themes, this will unfortunately do nothing.

This hint is required since we decided to disable spell checking by default. This is because of multiple reasons: this might cause some breakage for apps that are already doing its own TextArea modification.

The hard but powerful way

The second way to add spellchecking with Sonnet is to use the bindings directly. This makes it possible to configure the exact behavior of the spellchecking in your app. This is the API that qqc2-desktop-theme is using internally.

For that, you will then need to add the SpellcheckHighlighter directly to your TextArea.

import org.kde.kirigami 2.18 as Kirigami
import QtQuick.Controls.Template 2.15 as T

T.TextArea {
    id: controlRoot
    Sonnet.SpellcheckHighlighter {
        id: spellcheckhighlighter
        document: controlRoot.textDocument
        cursorPosition: controlRoot.cursorPosition
        selectionStart: controlRoot.selectionStart
        selectionEnd: controlRoot.selectionEnd
        misspelledColor: Kirigami.Theme.negativeTextColor

        onChangeCursorPosition: {
            controlRoot.cursorPosition = start;
            controlRoot.moveCursorSelection(end, TextEdit.SelectCharacters);
        }
    }
}

Sonnet.SpellcheckHighlighter exposes a few interesting methods that make it possible to get the spellchecker’s suggestions, add words to the dictionary, ignore some words and more. For those interested, I would recommend looking inside qqc2-desktop-theme and see how Sonnet is used.

Settings

Sonnet now also exports the spell-checking options to QML. You can find an example of how to use the exposed config object in NeoChat. I hope to move this code at some point in Kirigami Addons, so that not every app will need to implement its own setting config page.

NeoChat spellchecking options
NeoChat spellchecking options

This change opens the way to also port the global spell-checking options in Plasma System Settings to QML in the future.

Next plans

My next plan to make QML powerful in KDE is to figure out a way to upstream the nice KXMLGui/KConfigWidgets that I build for Kalendar into a separate component/library. This would make it possible to use a command bar, global menu bar, normal menu bar, configurable shortcuts and possibly more in a QML/Kirigami app.

This one is a bit tricky since dependency wise. Since all these features depends on QAction that depends directly on QtWidgets in Qt5. In Qt6 this now only depends on QtGUI but is is sill annoying that QAction can’t be used in QML but instead we have a QQuickAction that is part of the private QtQuick Controls 2 API.

Sunday, 24 October 2021

Linux Application Ecosystem Salon 2021 Changsha This weekend I traveled to Changsha for the Linux Application Ecosystem Salon 2021 Changsha, which is held by Ubuntu Kylin in the campus of Central South University. The journey itself is uneventful. I’ve never been to any offline Linux events before, I wanted to go to FOSDEM, but then the COVID hit. So anyway, it’s a first time for me. You can view the full news in Ubuntu Kylin’s post
In our last week of KDE Review, we have been focused on fixing as many bugs — big and small — as we have been able to. Thank you to everyone who has reported bugs, and thank you even more if you have helped in fixing them! Besides bug-fixes, we also have some pretty nifty …

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?

KLocalizedString

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.

KLazyLocalizedString

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(*it.name);

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(*it.name).toString();

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.

Outlook

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 https://planet.kde.org/, where you can find blog posts by other KDE contributors detailing the work they’re doing.

How You Can Help

Have a look at https://community.kde.org/Get_Involved 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. :-)

https://www.inkl.com/news/facebook-plans-to-rebrand-company-with-new-name-verge-says?share=pWQmVXfrAQr


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.

https://sfconservancy.org/copyleft-compliance/vizio.html


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.

https://ronjeffries.com/articles/021-01ff/jira-blades/


How to win at CORS - JakeArchibald.com

Tags: tech, http, cors

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

https://jakearchibald.com/2021/cors/


Hexagonal Architecture in Java Simplified

Tags: tech, java, architecture

Simple illustration of that software architecture pattern in Java

https://huseyinbabal.com/2021/10/15/hexagonal-architecture-in-java-simplified/


ELF dynamic linking: a brief introduction

Tags: tech, linking, elf

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

https://www.humprog.org/~stephen/blog/2021/10/18/#elf-dynamic-linking-intro


pyinstrument - pyinstrument 4.0.4 documentation

Tags: tech, python, profiling

Another profiler for Python which looks interesting.

https://pyinstrument.readthedocs.io/en/latest/home.html


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.

https://www.infoworld.com/article/3637073/python-stands-to-lose-its-gil-and-gain-a-lot-of-speed.html


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

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.

https://sethmlarson.dev/blog/2021-10-18/tests-arent-enough-case-study-after-adding-types-to-urllib3


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.

https://jacobian.org/2021/oct/20/simple-pm-tricks/


How to get useful answers to your questions

Tags: product-management, requirements

Very important skill indeed…

https://jvns.ca/blog/2021/10/21/how-to-get-useful-answers-to-your-questions/



Bye for now!

Stay in the loop: https://t.me/veggeroblog If you want to help me make these videos: Patreon: https://www.patreon.com/niccolove Youtube: https://www.youtube.com/channel/UCONH73CdRXUjlh3-DdLGCPw/join Paypal: https://paypal.me/niccolove My website is https://niccolo.venerandi.com 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;
  }
  sleep(3);
  delete splash;
  app.exec();

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 )
    r--;
  return r;
}

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

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

Found in koffice/filters/kocrypt/kocryptimport.cc, 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/kspread_cell.cc (KOffice 1.1), trying to save a date

     tmp=tmp.setNum(m_Validity->dateMin.year())+"/"+
         tmp.setNum(m_Validity->dateMin.month())+"/"+
         tmp.setNum(m_Validity->dateMin.day());

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 https://github.com/KDAB/GammaRay/blob/master/probe/entry_unix.cpp#L44)

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.