mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2025-06-13 05:37:42 +02:00
removed processEvents from ConcurrentTask
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
@ -37,6 +37,7 @@
|
||||
|
||||
#include "NetJob.h"
|
||||
#include "Application.h"
|
||||
#include "tasks/ConcurrentTask.h"
|
||||
|
||||
NetJob::NetJob(QString job_name, shared_qobject_ptr<QNetworkAccessManager> network)
|
||||
: ConcurrentTask(nullptr, job_name, APPLICATION->settings()->get("NumberOfConcurrentDownloads").toInt()), m_network(network)
|
||||
@ -51,18 +52,15 @@ auto NetJob::addNetAction(NetAction::Ptr action) -> bool
|
||||
return true;
|
||||
}
|
||||
|
||||
void NetJob::startNext()
|
||||
void NetJob::executeNextSubTask()
|
||||
{
|
||||
if (m_queue.isEmpty() && m_doing.isEmpty()) {
|
||||
// We're finished, check for failures and retry if we can (up to 3 times)
|
||||
if (!m_failed.isEmpty() && m_try < 3) {
|
||||
m_try += 1;
|
||||
while (!m_failed.isEmpty())
|
||||
m_queue.enqueue(m_failed.take(*m_failed.keyBegin()));
|
||||
}
|
||||
// We're finished, check for failures and retry if we can (up to 3 times)
|
||||
if (isRunning() && m_queue.isEmpty() && m_doing.isEmpty() && !m_failed.isEmpty() && m_try < 3) {
|
||||
m_try += 1;
|
||||
while (!m_failed.isEmpty())
|
||||
m_queue.enqueue(m_failed.take(*m_failed.keyBegin()));
|
||||
}
|
||||
|
||||
ConcurrentTask::startNext();
|
||||
ConcurrentTask::executeNextSubTask();
|
||||
}
|
||||
|
||||
auto NetJob::size() const -> int
|
||||
|
Reference in New Issue
Block a user