[pim/messagelib] messageviewer/src/dkim-verify: Save DKIM authentication servers immediately

Volker Krause <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit 31128509094cfd4955ee3b799826034935f37495 by Volker Krause.
Committed on 09/08/2026 at 13:28.
Pushed by vkrause into branch 'master'.

Save DKIM authentication servers immediately

As this is a singleton, saving in the dtor happens very late during
teardown, at a point KConfig's internals might already be gone.

Fixes an assert in a kdepim-addons unit test.

M  +2    -4    messageviewer/src/dkim-verify/dkimmanagerauthenticationserver.cpp

https://invent.kde.org/pim/messagelib/-/commit/31128509094cfd4955ee3b799826034935f37495

diff --git a/messageviewer/src/dkim-verify/dkimmanagerauthenticationserver.cpp b/messageviewer/src/dkim-verify/dkimmanagerauthenticationserver.cpp
index 0a4c68c37..cb4344e4c 100644
--- a/messageviewer/src/dkim-verify/dkimmanagerauthenticationserver.cpp
+++ b/messageviewer/src/dkim-verify/dkimmanagerauthenticationserver.cpp
@@ -21,10 +21,7 @@ DKIMManagerAuthenticationServer::DKIMManagerAuthenticationServer(QObject *parent
 {
 }
 
-DKIMManagerAuthenticationServer::~DKIMManagerAuthenticationServer()
-{
-    save();
-}
+DKIMManagerAuthenticationServer::~DKIMManagerAuthenticationServer() = default;
 
 DKIMManagerAuthenticationServer *DKIMManagerAuthenticationServer::self()
 {
@@ -40,6 +37,7 @@ QStringList DKIMManagerAuthenticationServer::serverList() const
 void DKIMManagerAuthenticationServer::setServerList(const QStringList &serverList)
 {
     mServerList = serverList;
+    save();
 }
 
 void DKIMManagerAuthenticationServer::load()
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.