diff --git a/src/ui/appinfo/appinfoworker.h b/src/ui/appinfo/appinfoworker.h index 7b526b4f..2effd28c 100644 --- a/src/ui/appinfo/appinfoworker.h +++ b/src/ui/appinfo/appinfoworker.h @@ -15,6 +15,8 @@ public: AppInfoManager *manager() const; + QThread::Priority priority() const override { return QThread::LowPriority; } + void run() override; protected: diff --git a/src/ui/util/worker/workerobject.cpp b/src/ui/util/worker/workerobject.cpp index cc8023e1..34e4db38 100644 --- a/src/ui/util/worker/workerobject.cpp +++ b/src/ui/util/worker/workerobject.cpp @@ -7,6 +7,8 @@ WorkerObject::WorkerObject(WorkerManager *manager) : m_manager(manager) { } void WorkerObject::run() { + QThread::currentThread()->setPriority(priority()); + for (;;) { WorkerJob *job = manager()->dequeueJob(); if (!job) diff --git a/src/ui/util/worker/workerobject.h b/src/ui/util/worker/workerobject.h index 92a6b2bb..80d50906 100644 --- a/src/ui/util/worker/workerobject.h +++ b/src/ui/util/worker/workerobject.h @@ -3,6 +3,7 @@ #include #include +#include class WorkerJob; class WorkerManager; @@ -14,6 +15,8 @@ public: WorkerManager *manager() const { return m_manager; } + virtual QThread::Priority priority() const { return QThread::NormalPriority; } + void run() override; protected: