MCPcopy Create free account
hub / github.com/FreesmTeam/FreesmLauncher / abort

Method abort

launcher/tasks/ConcurrentTask.cpp:70–97  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

68}
69
70bool ConcurrentTask::abort()
71{
72 m_queue.clear();
73
74 if (m_doing.isEmpty()) {
75 // Don't call emitAborted() here, we want to bypass the 'is the task running' check
76 emit aborted();
77 emit finished();
78
79 return true;
80 }
81
82 bool suceedeed = true;
83
84 QMutableHashIterator<Task*, Task::Ptr> doing_iter(m_doing);
85 while (doing_iter.hasNext()) {
86 auto task = doing_iter.next();
87 disconnect(task->get(), &Task::aborted, this, 0);
88 suceedeed &= (task.value())->abort();
89 }
90
91 if (suceedeed)
92 emitAborted();
93 else
94 emitFailed(tr("Failed to abort all running tasks."));
95
96 return suceedeed;
97}
98
99void ConcurrentTask::clear()
100{

Callers

nothing calls this directly

Calls 4

valueMethod · 0.80
clearMethod · 0.45
isEmptyMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected