When the component is completed the corona startup may not be complete
yet.
This causes a race condition when most of the times when a layout
is created from a lajout.js file, applets geometries don't get correctly
saved.
so reinvoke the save timer when the startup completed signal is emitted
from corona
BUG:433799
The context property version is slower to access and won't be supported
in Qt6. Let's port away from it and use the singleton version instead.
Here was my full process for making this change:
1. Made the change with `find . -name '*.qml' | xargs perl -pi -e 's/units\./PlasmaCore\.Units\./g'`
2. Verified no more occurrences with `grep -r " units."`
3. Made sure this didn't change any comments in a silly way by inspecting the output of `git diff | grep "+ " | grep "//"`
4. Manually inspected the full git diff to make sure there were no other unintentional or silly changes (there were none)
5. verified that all changed files have the PlasmaCore import with the correct name with `for FILE in `git status | grep modified | cut -d ":" -f 3`; do grep -q "as PlasmaCore" $FILE || echo "$FILE needs the PlasmaCore import"; done`
consider an applet acceptable for the formfactor if at least one
of its formfactors are contained in KDeclarative::runtimePlatform
or if either KDeclarative::runtimePlatform or applet formfactors
are empty.
(before informFactor failed if even one of the applet supported
formfactors was not in runtimePlatform
BUG:433983
ToolButton should not be used in shared component since it's clints
might have different representation.
Instead, make the component have no visual representation at all,
delegating it to clients themselves.
New error:
/usr/share/plasma/plasmoids/org.kde.plasma.keyboardlayout/contents/ui/
main.qml:17:5: Unable to assign [undefined] to QString
This is because just string is returned and not an object.
The expression should always return struct with proper fields instead.
it was technically possible for geometries to not be integer, but
a string to int parse was done, so teoretically string.toInt() can
fail and reset position/size of the plasmoid.
It may be the cause of some of the positions lost bugs.
This was particularly evident and triggerable in plasma mobile.
on palsma mobile side was also fixed by making suire the grid size is
always int, however technically the bug is here too as well
handles have to pop up on any background, as they will be on top of the wallpaper
adding a super light gradient which reminds breeze buttons, contrast pixel and
a shadow makes it easier for it to not get lost
onWheel is a bit messy with trackpads. It we just compare > 0 our scroll
rate is effectively determined by the refresh rate of the device. Use of
120 "wheels" is a common pattern used elsewhere.
Code is effectively copied from plasma-pa
The switch to previous/next direction I copied what was existing.
Return "layout" and "layoutsList" Properties where all layouts names are
now stored.
getLayoutLongName() DBus method is not used any more so it was also
deleted from DBus API in KWin and P-D, see corresponding commits there.
The Properties interface allows QML code be more declarative.
There is a trade-off though as now we have to:
- store all layout names on client side, even if it's not needed for
base QML layout component here
- duplicate layouts in layoutsList Property as they are also stored in
Action objects of the plasmoid in P-D.
Rework DBus API - getLayoutsList() now provides full details about the
layouts.
Remove Q_PROPERTY's as they are not make much sense here.
Port to a fully event-driven interface towards QML.
When rotated most applets, especially text look garbage.
If we render into an offscreen buffer we can smooth things out and it
looks good again. There is a performance penalty to this, but most
people do no not rotate plasmoids.
A new instance WidgetExplorer is created everytime we open get new
applets window. Each and every instance of WidgetExplorer has its own
newStuffDialog. This means that downloadWidgets method will always
create new instance of QtQuickDialogWrapper due to the default value of
newStuffDialog is null.
Change newStuffDialog to static so that it will be shared to every
instances of WidgetExplorer. This prevents another get new applets
window to be opened.
BUG: 412765
The QWidgets components are about to be deprecated
and the QtQuick dialog has a bunch of visual improvements.
Considering that most KCMs already use the QtQuick components
this MR improves the consistency.
See https://invent.kde.org/frameworks/knewstuff/-/merge_requests/80
for the MR which introduced the non-deprecated dialog class.
It was used to show the KNS dialog to download
wallpaper plugins. But nowadays we can and should
just use the QML components provided by KNewStuff directly.
All occurency in plasma-desktop, plasma-bigscreen and
plasma-nano have open MRs to port away from it (or just remove the import).
Considerations:
* In any point of time, the only layout info client might need is about:
- a single layout (the current one)
- list of all layouts configured (e.g to fill context menu entries)
There is no chance it might need to asqure some random layout info
which is not current.
* To get current layout Display Name, client shouldn't have to asqure
the current layout itself first - such dependecy makes code based on
async DBus API unnecessary complicated.
* Shall the layouts context menu be ever desired, it would be easy to
implement by adding both Name lists (Short/Long) and Index getters to
the API.
KWin/P-D parts:
impr: Keyboard Layout DBus API: drop excessive method arguments
No need to reimplement switching to the next layout logic in every QML
code - implemenation is already there on KWin/P-D side
KWin/P-D parts:
impr: Keyboard Layout DBus API: expose switchToNextLayout() method
KWin Wayland initially misused the DBus API and passed Long layout Name
via currentLayoutDisplayName() method which is wrong.
Instead, the new currentLayoutLongName() property should be added,
and Short Name be passed via currentLayoutDisplayName() as it is for
X11.
When layout changes, the country code (or short layout name) should be passed via DBus
from compositor to this C++ QML plugin, and then to a keyboard applet for
indication
CCBUG: 390079
KWin commit: "feat: expose keyboard layout Short Name via DBus"
We do this sometimes, but not consistenly.
The benefit is twofold.
First it improves the diff when adding new values since no existing line needs to be touched.
Second it prevents clang-format from collapsing the definition into a single line, which is undesired for large enums.
And use KPluginMetaData instead. It's what we get from the PackageLoader anyway.
Unlike KPluginInfo KPluginMetaData supports multiple authors. To keep the current behaviour of the model the code picks the first one and ignores the potential others.
Instead of using KPluginTrader's contraint system pass a filter function to KPackage::PackageLoader.
Also move the later filtering into said filter function.
This method calls doesn't seem to work anymore having been replaced by
the more intuitve virtual paths on the logind over a year ago.
Arguably that's still a bug upstream that GetSessionByPID no longer
works correctly, but we may as well port to the simpler path that avoids
so many layers of indirection.
Use of "/auto" does not exist on old distros so the legacy path is kept.
The paths used in this class were always wrong, which went unnoticed as
this is the first usage of them.
BUG: 423526