summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2023-02-13 00:57:23 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2023-02-13 00:57:23 +0900
commit4d90cc6117564d8aab9be1b65593161252f0298a (patch)
treec53a2ca4e23418eb72c8aea292bf357a4140dd96
parent9189a0e97f85abc0d9dce7c22016e9c8d634b3b1 (diff)
downloadtdelibs-4d90cc6117564d8aab9be1b65593161252f0298a.tar.gz
tdelibs-4d90cc6117564d8aab9be1b65593161252f0298a.zip
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 <michele.calgaro@yahoo.it>
-rw-r--r--tdeio/tdeio/job.cpp4
1 files changed, 3 insertions, 1 deletions
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'.