https://bugs.kde.org/show_bug.cgi?id=456958

--- Comment #15 from Nicolas Fella <nicolas.fe...@gmx.de> ---
Git commit 316ce3f9b42bfe9ea9d5f44cd37a452d2e0b71e8 by Nicolas Fella.
Committed on 22/08/2023 at 00:19.
Pushed by nicolasfella into branch 'master'.

Only store actual changes in config file for service shortcuts

Currently we store the full information for every shortcut in
kglobalshortcutsrc. These are internal name, user-facing name, current
shortcut, and default shortcut.

This has several problems:

It behaves differently to how config files usually work, which is only storing
non-default information.

We read the user-facing name from the original source once and then only
consider what we saved in the config file.
This means when the original name changes (e.g. because a translation was
added) we never update what we display.

Distributions/administrators can't supply changes to the defaults via the usual
way

The only piece of information that is changeable for the user is the current
shortcut. Store that in the config file, but only if it is not the default
value

The rest of the information (user-facing name and default shortcut) is read
from the desktop file.

This is only done for desktop-file-registered shortcuts. Runtime-registered
shortcuts have the same problem, but it's more complicated to fix there, so
that's for another day.
I expect us to move most if not all runtime shortcuts to desktop-file shortcuts
anyway

This breaks the config format, so on startup migrate the old data to the new
format, in a new group. To not break things for people switching between Plasma
5 and 6 for development
don't remove the old data. Once Plasma 6 matures we can consider dropping that
data

M  +5    -0    CMakeLists.txt
A  +3    -0    autotests/CMakeLists.txt
A  +309  -0    autotests/kglobalshortcutsrc
A  +319  -0    autotests/kglobalshortcutsrc.expected
A  +63   -0    autotests/migrateconfigtest.cpp     [License: LGPL(v2.0+)]
M  +3    -6    src/component.cpp
M  +6    -3    src/component.h
M  +1    -0    src/globalshortcutcontext.h
M  +87   -5    src/globalshortcutsregistry.cpp
M  +4    -1    src/globalshortcutsregistry.h
M  +53   -0    src/kserviceactioncomponent.cpp
M  +2    -1    src/kserviceactioncomponent.h

https://invent.kde.org/plasma/kglobalacceld/-/commit/316ce3f9b42bfe9ea9d5f44cd37a452d2e0b71e8

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to