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

Method executeTask

launcher/modplatform/flame/FileResolvingTask.cpp:17–35  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15}
16
17void Flame::FileResolvingTask::executeTask()
18{
19 setStatus(tr("Resolving mod IDs..."));
20 setProgress(0, 3);
21 m_dljob = new NetJob("Mod id resolver", m_network);
22 result.reset(new QByteArray());
23 //build json data to send
24 QJsonObject object;
25
26 object["fileIds"] = QJsonArray::fromVariantList(std::accumulate(m_toProcess.files.begin(), m_toProcess.files.end(), QVariantList(), [](QVariantList& l, const File& s) {
27 l.push_back(s.fileId);
28 return l;
29 }));
30 QByteArray data = Json::toText(object);
31 auto dl = Net::Upload::makeByteArray(QUrl("https://api.curseforge.com/v1/mods/files"), result.get(), data);
32 m_dljob->addNetAction(dl);
33 connect(m_dljob.get(), &NetJob::finished, this, &Flame::FileResolvingTask::netJobFinished);
34 m_dljob->start();
35}
36
37void Flame::FileResolvingTask::netJobFinished()
38{

Callers

nothing calls this directly

Calls 8

toTextFunction · 0.85
QUrlClass · 0.85
beginMethod · 0.80
endMethod · 0.80
addNetActionMethod · 0.80
resetMethod · 0.45
getMethod · 0.45
startMethod · 0.45

Tested by

no test coverage detected