| 5 | MinecraftLoadAndCheck::MinecraftLoadAndCheck(MinecraftInstance* inst, Net::Mode netmode) : m_inst(inst), m_netmode(netmode) {} |
| 6 | |
| 7 | void MinecraftLoadAndCheck::executeTask() |
| 8 | { |
| 9 | // add offline metadata load task |
| 10 | auto components = m_inst->getPackProfile(); |
| 11 | if (auto result = components->reload(m_netmode); !result) { |
| 12 | emitFailed(result.error); |
| 13 | return; |
| 14 | } |
| 15 | m_task = components->getCurrentTask(); |
| 16 | |
| 17 | if (!m_task) { |
| 18 | emitSucceeded(); |
| 19 | return; |
| 20 | } |
| 21 | connect(m_task.get(), &Task::succeeded, this, &MinecraftLoadAndCheck::emitSucceeded); |
| 22 | connect(m_task.get(), &Task::failed, this, &MinecraftLoadAndCheck::emitFailed); |
| 23 | connect(m_task.get(), &Task::aborted, this, [this] { emitFailed(tr("Aborted")); }); |
| 24 | connect(m_task.get(), &Task::progress, this, &MinecraftLoadAndCheck::setProgress); |
| 25 | connect(m_task.get(), &Task::stepProgress, this, &MinecraftLoadAndCheck::propagateStepProgress); |
| 26 | connect(m_task.get(), &Task::status, this, &MinecraftLoadAndCheck::setStatus); |
| 27 | connect(m_task.get(), &Task::details, this, &MinecraftLoadAndCheck::setDetails); |
| 28 | } |
| 29 | |
| 30 | bool MinecraftLoadAndCheck::canAbort() const |
| 31 | { |
nothing calls this directly
no test coverage detected