[pim/pim-sieve-editor] src: Make sure that we loadAccountSetting when empty

Laurent Montel <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit 8d82cfe14d0e2afe2e72004d26a39dc34604dec6 by Laurent Montel.
Committed on 14/08/2026 at 17:47.
Pushed by mlaurent into branch 'master'.

Make sure that we loadAccountSetting when empty

M  +7    -0    src/readserversieveconfigjob.cpp

https://invent.kde.org/pim/pim-sieve-editor/-/commit/8d82cfe14d0e2afe2e72004d26a39dc34604dec6

diff --git a/src/readserversieveconfigjob.cpp b/src/readserversieveconfigjob.cpp
index 45f3046f..569ac47c 100644
--- a/src/readserversieveconfigjob.cpp
+++ b/src/readserversieveconfigjob.cpp
@@ -45,6 +45,13 @@ void ReadServerSieveConfigJob::loadSettings(const QString &conf)
         group.readEntry(QStringLiteral("ImapEncrypt"), static_cast<int>(KSieveCore::SieveImapAccountSettings::SSLorTLS))));
     mCurrentSieveServerConfig.useImapCustomServer = group.readEntry(QStringLiteral("useImapCustomServer"), false);
 
+    if (mCurrentSieveServerConfig.sieveSettings.userName.isEmpty() && mCurrentSieveServerConfig.sieveSettings.serverName.isEmpty()) {
+        // Nothing was configured for this account: there is no password stored for it,
+        // so don't query the keychain with an empty identifier.
+        loadImapAccountSettings();
+        return;
+    }
+
     const QString walletEntry =
         SieveEditorUtil::sievePasswordIdentifier(mCurrentSieveServerConfig.sieveSettings.userName, mCurrentSieveServerConfig.sieveSettings.serverName);
     auto readJob = new ReadPasswordJob(SieveEditorUtil::walletFolderName(), this);
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.