changed items to shared ptrs

This commit is contained in:
itsmattkc
2019-07-06 12:50:00 -05:00
parent a6971b3fde
commit b62ec30015
12 changed files with 98 additions and 42 deletions
+19
View File
@@ -141,6 +141,18 @@ public:
*/
void AddDependency(Task* dependency);
public slots:
/**
* @brief Cancel the Task
*
* Sends a signal to the Task to stop and waits for the Task to finish before returning. Tasks must be responsive to
* cancelling so that the main thread doesn't halt for too long.
*
* Cancel()'s function is fairly simple, it sets cancelled_ to TRUE and waits for the thread to return. It's the
* responsibility of the code in Action() to be able to respond quickly to cancelled_ changing.
*/
void Cancel();
protected:
/**
* @brief Set the error message
@@ -159,6 +171,11 @@ protected:
*/
void set_text(const QString& s);
/**
* @brief Returns whether the thread has been explicitly cancelled or not
*/
bool cancelled();
signals:
/**
* @brief Signal emitted whenever the Task status changes
@@ -197,6 +214,8 @@ private:
QList<Task*> dependencies_;
bool cancelled_;
private slots:
/**
* @brief A slot when the inner thread completes either successfully or unsuccessfully