File 0001-Do-not-start-basejobs-twice.patch of Package attica-qt5.17058

From 695b8d8019ad6b335a97d8d4c69d2699385dce0c Mon Sep 17 00:00:00 2001
From: Aleix Pol <aleixpol@kde.org>
Date: Wed, 22 Sep 2021 16:40:08 +0200
Subject: [PATCH 1/2] Do not start basejobs twice

They will delete themselves when they're done with anyway.

(cherry picked from commit 24fc57ece156aaad1bbb86adba2e16c8e89dc6ff)
---
 src/atticabasejob.cpp | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/atticabasejob.cpp b/src/atticabasejob.cpp
index 8907ac1..39b3a04 100644
--- a/src/atticabasejob.cpp
+++ b/src/atticabasejob.cpp
@@ -25,6 +25,7 @@ public:
     Metadata m_metadata;
     PlatformDependent *m_internals;
     QNetworkReply *m_reply;
+    bool started = false;
 
     Private(PlatformDependent *internals)
         : m_internals(internals), m_reply(nullptr)
@@ -121,6 +122,10 @@ void BaseJob::dataFinished()
 
 void BaseJob::start()
 {
+    if (d->started) {
+        return;
+    }
+    d->started = true;
     QTimer::singleShot(0, this, &BaseJob::doWork);
 }
 
-- 
2.33.0

openSUSE Build Service is sponsored by