diff options
author | Petr Mrázek <peterix@gmail.com> | 2013-08-05 03:29:50 +0200 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2013-08-05 03:29:50 +0200 |
commit | 183a7351456940d01f14a49112ddeb68ffc4693a (patch) | |
tree | 579aeb0b8670e634de4f083e54b3c826bf548ec9 /backend/tasks/Task.h | |
parent | 005a010ee6a67191ec24583780310fcf217ff30c (diff) | |
download | MultiMC-183a7351456940d01f14a49112ddeb68ffc4693a.tar MultiMC-183a7351456940d01f14a49112ddeb68ffc4693a.tar.gz MultiMC-183a7351456940d01f14a49112ddeb68ffc4693a.tar.lz MultiMC-183a7351456940d01f14a49112ddeb68ffc4693a.tar.xz MultiMC-183a7351456940d01f14a49112ddeb68ffc4693a.zip |
Runnable 1.6 instances!
Diffstat (limited to 'backend/tasks/Task.h')
-rw-r--r-- | backend/tasks/Task.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/backend/tasks/Task.h b/backend/tasks/Task.h index c8c12c02..bbe27ae1 100644 --- a/backend/tasks/Task.h +++ b/backend/tasks/Task.h @@ -17,12 +17,11 @@ #define TASK_H #include <QObject> -#include <QThread> #include <QString> #include "libmmc_config.h" -class LIBMULTIMC_EXPORT Task : public QThread +class LIBMULTIMC_EXPORT Task : public QObject { Q_OBJECT public: @@ -34,6 +33,8 @@ public: QString getStatus() const; int getProgress() const; + bool isRunning() const; + /*! * \brief Calculates and sets the task's progress based on the number of parts completed out of the total number to complete. * This is essentially just shorthand for setProgress((parts / whole) * 100); @@ -43,7 +44,7 @@ public: */ void calcProgress(int parts, int whole); -public slots: +protected slots: void setStatus(const QString& status); void setProgress(int progress); @@ -54,7 +55,6 @@ signals: void started(); void ended(); - void statusChanged(Task* task, const QString& status); void progressChanged(Task* task, int progress); @@ -62,7 +62,6 @@ signals: void progressChanged(int progress); protected: - virtual void run(); virtual void executeTask() = 0; virtual void emitStarted(); @@ -73,6 +72,7 @@ protected: QString status; int progress; + bool running = false; }; #endif // TASK_H |