[plasma/plasma-nm] kded: secretagent: fix duplicate delete/update jobs

Marco Martin <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit d68ebdaf67062422240f54cd61e15d2caacd772f by Marco Martin, on behalf of Mickaël Thomas.
Committed on 10/08/2026 at 10:48.
Pushed by mart into branch 'master'.

secretagent: fix duplicate delete/update jobs

Once a DeleteSecrets/UpdateSecrets request has started its corresponding
QKeychain jobs, it should not create new ones every time processNext()
is called

M  +4    -4    kded/secretagent.cpp

https://invent.kde.org/plasma/plasma-nm/-/commit/d68ebdaf67062422240f54cd61e15d2caacd772f

diff --git a/kded/secretagent.cpp b/kded/secretagent.cpp
index ac30f472b..b1074fa55 100644
--- a/kded/secretagent.cpp
+++ b/kded/secretagent.cpp
@@ -494,8 +494,8 @@ bool SecretAgent::processSaveSecrets(QSharedPointer<SecretsRequest> request)
 {
     if (useSecureStorage()) {
         NetworkManager::ConnectionSettings connectionSettings(request->connection);
-        if (request->storageJobsRunning <= 0 && request->storageJobsStarted) {
-            return true;
+        if (request->storageJobsStarted) {
+            return (request->storageJobsRunning <= 0);
         }
         for (const NetworkManager::Setting::Ptr &setting : connectionSettings.settings()) {
             const auto secretsMap = setting->secretsToStringMap();
@@ -548,8 +548,8 @@ bool SecretAgent::processDeleteSecrets(QSharedPointer<SecretsRequest> request)
 {
     if (useSecureStorage()) {
         NetworkManager::ConnectionSettings connectionSettings(request->connection);
-        if (request->storageJobsRunning <= 0 && request->storageJobsStarted) {
-            return true;
+        if (request->storageJobsStarted) {
+            return (request->storageJobsRunning <= 0);
         }
         for (const NetworkManager::Setting::Ptr &setting : connectionSettings.settings()) {
             auto jobRequest = request.toWeakRef();
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.