2013-12-20 13:47:26 +00:00
|
|
|
#include "SequentialTask.h"
|
|
|
|
|
2022-05-09 14:53:52 +01:00
|
|
|
#include <QDebug>
|
|
|
|
|
2022-06-12 17:30:09 +01:00
|
|
|
SequentialTask::SequentialTask(QObject* parent, QString task_name) : ConcurrentTask(parent, task_name, 1) {}
|
2022-04-01 13:10:51 +01:00
|
|
|
|
2013-12-20 13:47:26 +00:00
|
|
|
void SequentialTask::startNext()
|
|
|
|
{
|
2022-06-12 17:30:09 +01:00
|
|
|
if (m_failed.size() > 0) {
|
|
|
|
emitFailed(tr("One of the tasks failed!"));
|
|
|
|
qWarning() << m_failed.constBegin()->get()->failReason();
|
2018-07-15 13:51:05 +01:00
|
|
|
return;
|
|
|
|
}
|
2022-04-01 13:10:51 +01:00
|
|
|
|
2022-06-12 17:30:09 +01:00
|
|
|
ConcurrentTask::startNext();
|
2013-12-20 13:47:26 +00:00
|
|
|
}
|
|
|
|
|
2022-06-12 17:30:09 +01:00
|
|
|
void SequentialTask::updateState()
|
2013-12-20 13:47:26 +00:00
|
|
|
{
|
2022-06-12 17:30:09 +01:00
|
|
|
setProgress(m_done.count(), m_total_size);
|
|
|
|
setStatus(tr("Executing task %1 out of %2").arg(QString::number(m_doing.count() + m_done.count()), QString::number(m_total_size)));
|
2013-12-20 13:47:26 +00:00
|
|
|
}
|