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.cpp | |
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.cpp')
-rw-r--r-- | backend/tasks/Task.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/backend/tasks/Task.cpp b/backend/tasks/Task.cpp index 7831ee58..30dd2d10 100644 --- a/backend/tasks/Task.cpp +++ b/backend/tasks/Task.cpp @@ -16,7 +16,7 @@ #include "Task.h" Task::Task(QObject *parent) : - QThread(parent) + QObject(parent) { } @@ -50,28 +50,30 @@ void Task::setProgress(int progress) void Task::startTask() { - start(); -} - -void Task::run() -{ emitStarted(); executeTask(); - emitEnded(); } void Task::emitStarted() { + running = true; emit started(); emit started(this); } void Task::emitEnded() { + running = false; emit ended(); emit ended(this); } +bool Task::isRunning() const +{ + return running; +} + + void Task::emitStatusChange(const QString &status) { emit statusChanged(status); |