From 4d90cc6117564d8aab9be1b65593161252f0298a Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Mon, 13 Feb 2023 00:57:23 +0900 Subject: [PATCH] Add single TQObject root parent for all TDEIO::Job objects. This helps keeping the object root list shorter, speeding up operations which require lot of TQObject trees. This relates to TDE/tdebase#309. Signed-off-by: Michele Calgaro --- tdeio/tdeio/job.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tdeio/tdeio/job.cpp b/tdeio/tdeio/job.cpp index f6156a966..2c17d8534 100644 --- a/tdeio/tdeio/job.cpp +++ b/tdeio/tdeio/job.cpp @@ -106,7 +106,9 @@ public: unsigned long m_userTimestamp; }; -Job::Job(bool showProgressInfo) : TQObject(0, "job"), m_error(0), m_percent(0) +static TQObject *__job_root_obj = new TQObject(0, "jobroot"); + +Job::Job(bool showProgressInfo) : TQObject(__job_root_obj, "job"), m_error(0), m_percent(0) , m_progressId(0), m_speedTimer(0), d( new JobPrivate ) { // All jobs delete themselves after emiting 'result'.