We make use of the Windows Registry to set cofiguration values for Kleopatra. https://gnupg.com/vsd/kleopatra-settings.html
For that we use the following patch:
https://invent.kde.org/frameworks/kconfig/-/merge_requests/146
That patch is a bit stupid, it should use QSettings instead of manually reading the registry. But the biggest issue I have with it is that it is not generic enough. It only works for kleopatrarc but not for something like kleopatragroupsrc or libkleopatrarc etc.
But still in general it is ok. The order should be:
- Read values from XDG_SYSTEM_DIRS
- Read from HKLM registry
- Read from HKCU registry
- Read from XFDG_CONFIG_DIRS
And write only to the local XDG_CONFIG_DIRS stuff.
We need it to be configurable where the "root" key is. Currently we set it this way:
diff --git a/src/kleopatraapplication.cpp b/src/kleopatraapplication.cpp index 0528076b..d4cb93ac 100644 --- a/src/kleopatraapplication.cpp +++ b/src/kleopatraapplication.cpp @@ -299,6 +299,7 @@ void KleopatraApplication::init() { #ifdef Q_OS_WIN QWindowsWindowFunctions::setWindowActivationBehavior(QWindowsWindowFunctions::AlwaysActivateWindow); + KConfig::setWindowsRegistryKey(QStringLiteral("SOFTWARE\\GNU\\Kleopatra")); #endif const auto blockedUrlSchemes = Settings{}.blockedUrlSchemes(); for (const auto &scheme : blockedUrlSchemes) {
Better would be e.g. an API where it uses organization name by default and a way to override that so that it works for us. It must be compatible with the current registry settings we have as linkled above.