diff options
author | Petr Mrázek <peterix@gmail.com> | 2017-06-26 01:14:32 +0200 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2017-06-26 01:14:32 +0200 |
commit | 89d3a66658ebdb16582a4d7a2cab57cfd6906393 (patch) | |
tree | f3b4daf14a18db76de1b9998da16b505b3872d10 /api/logic/tasks/Task.h | |
parent | 2973b11d3edf47fe437af4dd1dc1a5f250c49ba3 (diff) | |
download | MultiMC-89d3a66658ebdb16582a4d7a2cab57cfd6906393.tar MultiMC-89d3a66658ebdb16582a4d7a2cab57cfd6906393.tar.gz MultiMC-89d3a66658ebdb16582a4d7a2cab57cfd6906393.tar.lz MultiMC-89d3a66658ebdb16582a4d7a2cab57cfd6906393.tar.xz MultiMC-89d3a66658ebdb16582a4d7a2cab57cfd6906393.zip |
NOISSUE some safe refactors and changes of the task subsystem
Possibly also some bug fixes.
Diffstat (limited to 'api/logic/tasks/Task.h')
-rw-r--r-- | api/logic/tasks/Task.h | 19 |
1 files changed, 6 insertions, 13 deletions
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; |