summaryrefslogtreecommitdiffstats
path: root/tdeio
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2023-06-12 22:15:53 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2023-06-12 22:15:53 +0900
commit54b58986491c48408c720d706e5cbfd1043d3ee6 (patch)
treeb9f0dca3b1aa454c8edabb9789a4aed96f8a9dab /tdeio
parent9440fb5585daea464012451a5afd358e785826d2 (diff)
downloadtdelibs-54b58986491c48408c720d706e5cbfd1043d3ee6.tar.gz
tdelibs-54b58986491c48408c720d706e5cbfd1043d3ee6.zip
Rework and fix commit 4d90cc61
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'tdeio')
-rw-r--r--tdeio/tdeio/job.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/tdeio/tdeio/job.cpp b/tdeio/tdeio/job.cpp
index 43b0c808b..cbe1a81d5 100644
--- a/tdeio/tdeio/job.cpp
+++ b/tdeio/tdeio/job.cpp
@@ -114,9 +114,18 @@ public:
unsigned long m_userTimestamp;
};
-static TQObject *__job_root_obj = new TQObject(0, "jobroot");
+static TQObject *__job_root_obj = nullptr;
-Job::Job(bool showProgressInfo) : TQObject(__job_root_obj, "job"), m_error(0), m_percent(0)
+static TQObject* __getJobRoot()
+{
+ if (!__job_root_obj)
+ {
+ __job_root_obj = new TQObject(0, "jobroot");
+ }
+ return __job_root_obj;
+}
+
+Job::Job(bool showProgressInfo) : TQObject(__getJobRoot(), "job"), m_error(0), m_percent(0)
, m_progressId(0), m_speedTimer(0), d( new JobPrivate )
{
// All jobs delete themselves after emiting 'result'.