aboutsummaryrefslogtreecommitdiff
path: root/launcher/modplatform/atlauncher/ATLPackInstallTask.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'launcher/modplatform/atlauncher/ATLPackInstallTask.cpp')
-rw-r--r--launcher/modplatform/atlauncher/ATLPackInstallTask.cpp29
1 files changed, 23 insertions, 6 deletions
diff --git a/launcher/modplatform/atlauncher/ATLPackInstallTask.cpp b/launcher/modplatform/atlauncher/ATLPackInstallTask.cpp
index 9ef32db1..e5db512e 100644
--- a/launcher/modplatform/atlauncher/ATLPackInstallTask.cpp
+++ b/launcher/modplatform/atlauncher/ATLPackInstallTask.cpp
@@ -1,3 +1,20 @@
+/*
+ * Copyright 2020-2021 Jamie Mansfield <jmansfield@cadixdev.org>
+ * Copyright 2021 Petr Mrazek <peterix@gmail.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
#include "ATLPackInstallTask.h"
#include <QtConcurrent/QtConcurrent>
@@ -41,12 +58,12 @@ bool PackInstallTask::abort()
void PackInstallTask::executeTask()
{
qDebug() << "PackInstallTask::executeTask: " << QThread::currentThreadId();
- auto *netJob = new NetJob("ATLauncher::VersionFetch");
+ auto *netJob = new NetJob("ATLauncher::VersionFetch", APPLICATION->network());
auto searchUrl = QString(BuildConfig.ATL_DOWNLOAD_SERVER_URL + "packs/%1/versions/%2/Configs.json")
.arg(m_pack).arg(m_version_name);
netJob->addNetAction(Net::Download::makeByteArray(QUrl(searchUrl), &response));
jobPtr = netJob;
- jobPtr->start(APPLICATION->network());
+ jobPtr->start();
QObject::connect(netJob, &NetJob::succeeded, this, &PackInstallTask::onDownloadSucceeded);
QObject::connect(netJob, &NetJob::failed, this, &PackInstallTask::onDownloadFailed);
@@ -407,7 +424,7 @@ void PackInstallTask::installConfigs()
{
qDebug() << "PackInstallTask::installConfigs: " << QThread::currentThreadId();
setStatus(tr("Downloading configs..."));
- jobPtr.reset(new NetJob(tr("Config download")));
+ jobPtr = new NetJob(tr("Config download"), APPLICATION->network());
auto path = QString("Configs/%1/%2.zip").arg(m_pack).arg(m_version_name);
auto url = QString(BuildConfig.ATL_DOWNLOAD_SERVER_URL + "packs/%1/versions/%2/Configs.zip")
@@ -441,7 +458,7 @@ void PackInstallTask::installConfigs()
setProgress(current, total);
});
- jobPtr->start(APPLICATION->network());
+ jobPtr->start();
}
void PackInstallTask::extractConfigs()
@@ -491,7 +508,7 @@ void PackInstallTask::downloadMods()
setStatus(tr("Downloading mods..."));
jarmods.clear();
- jobPtr.reset(new NetJob(tr("Mod download")));
+ jobPtr = new NetJob(tr("Mod download"), APPLICATION->network());
for(const auto& mod : m_version.mods) {
// skip non-client mods
if(!mod.client) continue;
@@ -596,7 +613,7 @@ void PackInstallTask::downloadMods()
setProgress(current, total);
});
- jobPtr->start(APPLICATION->network());
+ jobPtr->start();
}
void PackInstallTask::onModsDownloaded() {