MCPcopy Create free account
hub / github.com/PolyMC/PolyMC / abort

Method abort

launcher/tasks/ConcurrentTask.cpp:47–74  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45}
46
47bool ConcurrentTask::abort()
48{
49 m_queue.clear();
50 m_aborted = true;
51
52 if (m_doing.isEmpty()) {
53 // Don't call emitAborted() here, we want to bypass the 'is the task running' check
54 emit aborted();
55 emit finished();
56
57 return true;
58 }
59
60 bool suceedeed = true;
61
62 QMutableHashIterator<Task*, Task::Ptr> doing_iter(m_doing);
63 while (doing_iter.hasNext()) {
64 auto task = doing_iter.next();
65 suceedeed &= (task.value())->abort();
66 }
67
68 if (suceedeed)
69 emitAborted();
70 else
71 emitFailed(tr("Failed to abort all running tasks."));
72
73 return suceedeed;
74}
75
76void ConcurrentTask::startNext()
77{

Callers

nothing calls this directly

Calls 3

isEmptyMethod · 0.80
nextMethod · 0.80
clearMethod · 0.45

Tested by

no test coverage detected