made the number of concurrent tasks configurable

Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
Trial97
2023-07-14 20:39:53 +03:00
parent 3becd4386b
commit cebb4dd17a
8 changed files with 38 additions and 6 deletions

View File

@ -41,6 +41,7 @@
#include <QUuid>
#include <memory>
#include "Application.h"
#include "tasks/Task.h"
class ConcurrentTask : public Task {
@ -48,7 +49,9 @@ class ConcurrentTask : public Task {
public:
using Ptr = shared_qobject_ptr<ConcurrentTask>;
explicit ConcurrentTask(QObject* parent = nullptr, QString task_name = "", int max_concurrent = 6);
explicit ConcurrentTask(QObject* parent = nullptr,
QString task_name = "",
int max_concurrent = APPLICATION->settings()->get("NumberOfConcurrentTasks").toInt());
~ConcurrentTask() override;
bool canAbort() const override { return true; }