feat(Tasks): add ConcurrentTask::clear to allow re-using tasks
This way old runs won't pile up in the internal DSs Signed-off-by: flow <flowlnlnln@gmail.com>
This commit is contained in:
		| @@ -73,6 +73,22 @@ bool ConcurrentTask::abort() | ||||
|     return suceedeed; | ||||
| } | ||||
|  | ||||
| void ConcurrentTask::clear() | ||||
| { | ||||
|     Q_ASSERT(!isRunning()); | ||||
|  | ||||
|     m_done.clear(); | ||||
|     m_failed.clear(); | ||||
|     m_queue.clear(); | ||||
|  | ||||
|     m_aborted = false; | ||||
|  | ||||
|     m_progress = 0; | ||||
|     m_stepProgress = 0; | ||||
|  | ||||
|     m_total_size = 0; | ||||
| } | ||||
|  | ||||
| void ConcurrentTask::startNext() | ||||
| { | ||||
|     if (m_aborted || m_doing.count() > m_total_max_size) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 flow
					flow