fix: abort and fail logic in tasks

Also sets up correctly the status connections
This commit is contained in:
flow
2022-05-01 11:05:31 -03:00
parent 040ee919e5
commit 57d65177c8
4 changed files with 11 additions and 4 deletions

View File

@ -100,6 +100,7 @@ void Task::emitAborted()
m_failReason = "Aborted.";
qDebug() << "Task" << describe() << "aborted.";
emit aborted();
emit finished();
}
void Task::emitSucceeded()

View File

@ -79,7 +79,7 @@ class Task : public QObject {
public slots:
virtual void start();
virtual bool abort() { return false; };
virtual bool abort() { if(canAbort()) emitAborted(); return canAbort(); };
protected:
virtual void executeTask() = 0;