From 89d3a66658ebdb16582a4d7a2cab57cfd6906393 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Mon, 26 Jun 2017 01:14:32 +0200 Subject: NOISSUE some safe refactors and changes of the task subsystem Possibly also some bug fixes. --- api/logic/tasks/Task.h | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) (limited to 'api/logic/tasks/Task.h') diff --git a/api/logic/tasks/Task.h b/api/logic/tasks/Task.h index 47c4a13e..3654ed24 100644 --- a/api/logic/tasks/Task.h +++ b/api/logic/tasks/Task.h @@ -27,21 +27,15 @@ public: explicit Task(QObject *parent = 0); virtual ~Task() {}; - virtual bool isRunning() const; - - virtual bool isFinished() const; - - /*! - * True if this task was successful. - * If the task failed or is still running, returns false. - */ - virtual bool successful() const; + bool isRunning() const; + bool isFinished() const; + bool wasSuccessful() const; /*! * Returns the string that was passed to emitFailed as the error message when the task failed. * If the task hasn't failed, returns an empty string. */ - virtual QString failReason() const; + QString failReason() const; virtual bool canAbort() const { return false; } @@ -68,8 +62,7 @@ signals: void failed(QString reason); void status(QString status); -public -slots: +public slots: virtual void start(); virtual bool abort() { return false; }; @@ -84,7 +77,7 @@ public slots: void setStatus(const QString &status); void setProgress(qint64 current, qint64 total); -protected: +private: bool m_running = false; bool m_finished = false; bool m_succeeded = false; -- cgit v1.2.3