akonadi-server/0001-Fix-wrong-for-clause-in-Akonadi-Session.patch

54 lines
1.7 KiB
Diff
Raw Normal View History

From 0ab418bacdaf8322771e41452a87d062a2449869 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ji=C5=99=C3=AD=20Pale=C4=8Dek?= <jpalecek@web.de>
Date: Thu, 20 Apr 2023 16:17:12 +0200
Subject: [PATCH 1/3] Fix wrong for clause in Akonadi::Session
BUG: 468343
BUG: 465245
BUG: 464275
BUG: 462213
BUG: 462169
BUG: 461131
BUG: 460653
BUG: 460586
BUG: 458497
BUG: 458315
(cherry picked from commit eca4fdbdf328883ae564b568c9ba13697cc90c4a)
---
src/core/session.cpp | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/src/core/session.cpp b/src/core/session.cpp
index 227dda367..46106b923 100644
--- a/src/core/session.cpp
+++ b/src/core/session.cpp
@@ -293,7 +293,8 @@ void SessionPrivate::serverStateChanged(ServerManager::State state)
} else if (!connected && state == ServerManager::Broken) {
// If the server is broken, cancel all pending jobs, otherwise they will be
// blocked forever and applications waiting for them to finish would be stuck
- for (Job *job : std::as_const(queue)) {
+ auto q = queue;
+ for (Job *job : q) {
job->setError(Job::ConnectionFailed);
job->kill(KJob::EmitResult);
}
@@ -435,11 +436,13 @@ void Session::clear()
void SessionPrivate::clear(bool forceReconnect)
{
- for (Job *job : std::as_const(queue)) {
+ auto q = queue;
+ for (Job *job : q) {
job->kill(KJob::EmitResult); // safe, not started yet
}
queue.clear();
- for (Job *job : std::as_const(pipeline)) {
+ auto p = pipeline;
+ for (Job *job : p) {
job->d_ptr->mStarted = false; // avoid killing/reconnect loops
job->kill(KJob::EmitResult);
}
--
2.40.0