summaryrefslogtreecommitdiffstats
path: root/logic/tasks/Task.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'logic/tasks/Task.cpp')
-rw-r--r--logic/tasks/Task.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/logic/tasks/Task.cpp b/logic/tasks/Task.cpp
index 47214723..cb7a5443 100644
--- a/logic/tasks/Task.cpp
+++ b/logic/tasks/Task.cpp
@@ -53,6 +53,8 @@ void Task::start()
void Task::emitFailed(QString reason)
{
m_running = false;
+ m_succeeded = false;
+ m_failReason = reason;
QLOG_ERROR() << "Task failed: " << reason;
emit failed(reason);
}
@@ -60,6 +62,8 @@ void Task::emitFailed(QString reason)
void Task::emitSucceeded()
{
m_running = false;
+ m_succeeded = true;
+ QLOG_INFO() << "Task succeeded";
emit succeeded();
}
@@ -67,3 +71,14 @@ bool Task::isRunning() const
{
return m_running;
}
+
+bool Task::successful() const
+{
+ return m_succeeded;
+}
+
+QString Task::failReason() const
+{
+ return m_failReason;
+}
+