diff options
Diffstat (limited to 'logic/tasks/Task.h')
-rw-r--r-- | logic/tasks/Task.h | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/logic/tasks/Task.h b/logic/tasks/Task.h index 9362348a..04899c69 100644 --- a/logic/tasks/Task.h +++ b/logic/tasks/Task.h @@ -27,6 +27,8 @@ public: virtual bool isRunning() const; + virtual bool isFinished() const; + /*! * True if this task was successful. * If the task failed or is still running, returns false. @@ -41,6 +43,21 @@ public: virtual bool canAbort() const { return false; } + QString getStatus() + { + return m_status; + } + + qint64 getProgress() + { + return m_progress; + } + + qint64 getTotalProgress() + { + return m_progressTotal; + } + signals: void started(); void progress(qint64 current, qint64 total); @@ -61,14 +78,17 @@ protected slots: virtual void emitSucceeded(); virtual void emitFailed(QString reason); -protected -slots: +public slots: void setStatus(const QString &status); - void setProgress(int progress); + void setProgress(qint64 current, qint64 total); protected: bool m_running = false; + bool m_finished = false; bool m_succeeded = false; QString m_failReason = ""; + QString m_status; + int m_progress = 0; + int m_progressTotal = 100; }; |