This fixes the following compiler error with winrt headers using mingw-w64 gcc toolchain.
In file included from winrt/Windows.Foundation.h:12,
from kdeconnect-kde/plugins/sendnotifications/windowsnotificationslistener.h:11,
from kdeconnect-kde/plugins/sendnotifications/sendnotificationsplugin.cpp:12:
winrt/base.h:89:2: error: #error C++/WinRT requires coroutine support, which is currently missing. Try enabling C++20 in your compiler.
89 | #error C++/WinRT requires coroutine support, which is currently missing. Try enabling C++20 in your compiler.
| ^~~~~
We don't need to convert the data to an intermediate QVariantMap just to
make JSON out of it. This siginificantly improves performance.
The measurements were done with 3000000 iterations each:
Before serialization: 0.0045009 msecs
Before deserialization: 0.002293 msecs
After serialization: 0.0034216 msecs (32% faster)
After deserialization: 0.001776 msecs (29% faster)
The Add command dialog currently does not set a preferredWidth, which
seems to cause repeated binding loops and a lot of log spam until the
dialog is actually put on screen.
This change sets the preferredWidth to 20*gridUnit, which seems to be
the typical size used in small dialogs and is about the size that the
dialog has without a width explicitly set.
While the HIG is not quite clear on this, PlaceholderMessages throughout
KDE applications and kcms tend to have sentence capitalization in their
title and include a verb (e.g. "Playlist is empty", "No game controllers
found"). The runcommand plugin breaks with this; it uses title
capitalization and does not include a verb: "No Commands".
This change modifies the title to read "No commands configured".
The ListView displaying the configured actions currently directly uses a
label that is made multi-line by including a newline. As a consequence,
eliding the text does not work properly and there is a visual clash with
the included action button. It also means that there is a rather
pointlessly translatable string that is just there for UI logic.
This change modifies the delegate to use a ColumnLayout instead, which
enables correct eliding of the labels and more cleanly separates layout
and content concerns.
The HIG recommend that buttons with an action label that require further
user input end in an ellipsis, and that dialog buttons should clearly
indicate what they do. Button labels typically do not match the given
exceptions that license sentence case. Currently, the main "Add command"
button in the configuration button does not end in an ellipsis even
though it opens a dialog, is sentence case, and the dialog has a "Save"
rather than the customary "Add" that is used for these kinds of actions,
in particular in kcms. The dialog title is also not translatable.
This change adds the ellipsis, converts the button to title case, makes
the dialog title translatable, and adds an "Add" button as an action to
the dialog.