Page MenuHome GnuPG

Kleopatra: Use windows registry additionally to config files
Open, NormalPublic

Description

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:

  1. Read values from XDG_SYSTEM_DIRS
  2. Read from HKLM registry
  3. Read from HKCU registry
  4. 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.

Event Timeline

aheinecke triaged this task as Normal priority.Nov 30 2021, 8:52 AM
aheinecke created this task.
aheinecke renamed this task from Kleopatra: Evaluate registry settings to Kleopatra: Use windows registry additionally to config files.Thu, Feb 8, 9:23 AM
aheinecke reassigned this task from aheinecke to TobiasFella.
aheinecke updated the task description. (Show Details)
aheinecke added a project: Restricted Project.Thu, Feb 8, 9:56 AM
TobiasFella moved this task from Restricted Project Column to Restricted Project Column on the Restricted Project board.Thu, Feb 15, 8:59 AM