diff options
author | Petr Mrázek <peterix@gmail.com> | 2021-11-21 23:21:12 +0100 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2021-11-21 23:21:12 +0100 |
commit | 69213b1206e97f7d4db4270a4b3b0af41dc9e6fc (patch) | |
tree | b53ca69422ce22cceee9e648171a678679075c1a /launcher/modplatform/modpacksch/FTBPackInstallTask.cpp | |
parent | c2c56a2f6ceaedb8a3fa88c848b345db0fec7f9c (diff) | |
download | PrismLauncher-69213b1206e97f7d4db4270a4b3b0af41dc9e6fc.tar.gz PrismLauncher-69213b1206e97f7d4db4270a4b3b0af41dc9e6fc.tar.bz2 PrismLauncher-69213b1206e97f7d4db4270a4b3b0af41dc9e6fc.zip |
NOISSUE continue refactoring things to make tests pass
Diffstat (limited to 'launcher/modplatform/modpacksch/FTBPackInstallTask.cpp')
-rw-r--r-- | launcher/modplatform/modpacksch/FTBPackInstallTask.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/launcher/modplatform/modpacksch/FTBPackInstallTask.cpp b/launcher/modplatform/modpacksch/FTBPackInstallTask.cpp index 785d3dd6..563b5cfa 100644 --- a/launcher/modplatform/modpacksch/FTBPackInstallTask.cpp +++ b/launcher/modplatform/modpacksch/FTBPackInstallTask.cpp @@ -1,7 +1,5 @@ #include "FTBPackInstallTask.h" -#include "BuildConfig.h" -#include "Env.h" #include "FileSystem.h" #include "Json.h" #include "minecraft/MinecraftInstance.h" @@ -9,6 +7,9 @@ #include "net/ChecksumValidator.h" #include "settings/INISettingsObject.h" +#include "BuildConfig.h" +#include "Application.h" + namespace ModpacksCH { PackInstallTask::PackInstallTask(Modpack pack, QString version) @@ -50,7 +51,7 @@ void PackInstallTask::executeTask() .arg(m_pack.id).arg(version.id); netJob->addNetAction(Net::Download::makeByteArray(QUrl(searchUrl), &response)); jobPtr = netJob; - jobPtr->start(); + jobPtr->start(APPLICATION->network()); QObject::connect(netJob, &NetJob::succeeded, this, &PackInstallTask::onDownloadSucceeded); QObject::connect(netJob, &NetJob::failed, this, &PackInstallTask::onDownloadFailed); @@ -95,14 +96,14 @@ void PackInstallTask::downloadPack() { setStatus(tr("Downloading mods...")); - jobPtr.reset(new NetJob(tr("Mod download"))); + jobPtr = new NetJob(tr("Mod download")); for(auto file : m_version.files) { if(file.serverOnly) continue; QFileInfo fileName(file.name); auto cacheName = fileName.completeBaseName() + "-" + file.sha1 + "." + fileName.suffix(); - auto entry = ENV->metacache()->resolveEntry("ModpacksCHPacks", cacheName); + auto entry = APPLICATION->metacache()->resolveEntry("ModpacksCHPacks", cacheName); entry->setStale(true); auto relpath = FS::PathCombine("minecraft", file.path, file.name); @@ -141,7 +142,7 @@ void PackInstallTask::downloadPack() setProgress(current, total); }); - jobPtr->start(); + jobPtr->start(APPLICATION->network()); } void PackInstallTask::install() |