| 91 | } |
| 92 | |
| 93 | void 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 | |
| 113 | QString InstanceImportTask::getRootFromZip(QuaZip* zip, const QString& root) |
| 114 | { |
nothing calls this directly
no test coverage detected