Skip to content

Only store actual changes in config file for service shortcuts

Nicolas Fella requested to merge work/nico/migrate into master

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

CCBUG: 456958

Merge request reports