MCPcopy Create free account
hub / github.com/MultiMC/Launcher / versionSucceeded

Method versionSucceeded

launcher/modplatform/technic/SolderPackInstallTask.cpp:53–76  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51}
52
53void Technic::SolderPackInstallTask::versionSucceeded()
54{
55 try
56 {
57 QJsonDocument doc = Json::requireDocument(m_response);
58 QJsonObject obj = Json::requireObject(doc);
59 QString version = Json::requireString(obj, "recommended", "__placeholder__");
60 m_sourceUrl = m_sourceUrl.toString() + '/' + version;
61 }
62 catch (const JSONValidationError &e)
63 {
64 emitFailed(e.cause());
65 m_filesNetJob.reset();
66 return;
67 }
68
69 setStatus(tr("Resolving modpack files:\n%1").arg(m_sourceUrl.toString()));
70 m_filesNetJob = new NetJob(tr("Resolving modpack files"), m_network);
71 m_filesNetJob->addNetAction(Net::Download::makeByteArray(m_sourceUrl, &m_response));
72 auto job = m_filesNetJob.get();
73 connect(job, &NetJob::succeeded, this, &Technic::SolderPackInstallTask::fileListSucceeded);
74 connect(job, &NetJob::failed, this, &Technic::SolderPackInstallTask::downloadFailed);
75 m_filesNetJob->start();
76}
77
78void Technic::SolderPackInstallTask::fileListSucceeded()
79{

Callers

nothing calls this directly

Calls 8

requireDocumentFunction · 0.85
requireObjectFunction · 0.85
causeMethod · 0.80
addNetActionMethod · 0.80
toStringMethod · 0.45
resetMethod · 0.45
getMethod · 0.45
startMethod · 0.45

Tested by

no test coverage detected