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

Method downloadFromUrl

launcher/InstanceImportTask.cpp:93–111  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

91}
92
93void InstanceImportTask::downloadFromUrl()
94{
95 const QString path(m_sourceUrl.host() + '/' + m_sourceUrl.path());
96
97 auto entry = APPLICATION->metacache()->resolveEntry("general", path);
98 entry->setStale(true);
99 m_archivePath = entry->getFullPath();
100
101 auto filesNetJob = makeShared<NetJob>(tr("Modpack download"), APPLICATION->network());
102 filesNetJob->addNetAction(Net::ApiDownload::makeCached(m_sourceUrl, entry));
103
104 connect(filesNetJob.get(), &NetJob::succeeded, this, &InstanceImportTask::processZipPack);
105 connect(filesNetJob.get(), &NetJob::progress, this, &InstanceImportTask::setProgress);
106 connect(filesNetJob.get(), &NetJob::stepProgress, this, &InstanceImportTask::propagateStepProgress);
107 connect(filesNetJob.get(), &NetJob::failed, this, &InstanceImportTask::emitFailed);
108 connect(filesNetJob.get(), &NetJob::aborted, this, &InstanceImportTask::emitAborted);
109 m_task.reset(filesNetJob);
110 filesNetJob->start();
111}
112
113QString InstanceImportTask::getRootFromZip(QuaZip* zip, const QString& root)
114{

Callers

nothing calls this directly

Calls 10

resolveEntryMethod · 0.80
metacacheMethod · 0.80
getFullPathMethod · 0.80
networkMethod · 0.80
addNetActionMethod · 0.80
pathMethod · 0.45
setStaleMethod · 0.45
getMethod · 0.45
resetMethod · 0.45
startMethod · 0.45

Tested by

no test coverage detected