diff options
Diffstat (limited to 'launcher/updater')
-rw-r--r-- | launcher/updater/DownloadTask.cpp | 8 | ||||
-rw-r--r-- | launcher/updater/DownloadTask_test.cpp | 3 | ||||
-rw-r--r-- | launcher/updater/UpdateChecker.cpp | 8 |
3 files changed, 10 insertions, 9 deletions
diff --git a/launcher/updater/DownloadTask.cpp b/launcher/updater/DownloadTask.cpp index eba59142..48fe767a 100644 --- a/launcher/updater/DownloadTask.cpp +++ b/launcher/updater/DownloadTask.cpp @@ -47,7 +47,7 @@ void DownloadTask::loadVersionInfo() { setStatus(tr("Loading version information...")); - NetJob *netJob = new NetJob("Version Info"); + NetJob *netJob = new NetJob("Version Info", m_network); // Find the index URL. QUrl newIndexUrl = QUrl(m_status.newRepoUrl).resolved(QString::number(m_status.newVersionId) + ".json"); @@ -67,7 +67,7 @@ void DownloadTask::loadVersionInfo() connect(netJob, &NetJob::succeeded, this, &DownloadTask::processDownloadedVersionInfo); connect(netJob, &NetJob::failed, this, &DownloadTask::vinfoDownloadFailed); m_vinfoNetJob.reset(netJob); - netJob->start(m_network); + netJob->start(); } void DownloadTask::vinfoDownloadFailed() @@ -121,7 +121,7 @@ void DownloadTask::processDownloadedVersionInfo() setStatus(tr("Processing file lists - figuring out how to install the update...")); // make a new netjob for the actual update files - NetJob::Ptr netJob (new NetJob("Update Files")); + NetJob::Ptr netJob = new NetJob("Update Files", m_network); // fill netJob and operationList if (!processFileLists(m_currentVersionFileList, m_newVersionFileList, m_status.rootPath, m_updateFilesDir.path(), netJob, m_operations)) @@ -145,7 +145,7 @@ void DownloadTask::processDownloadedVersionInfo() } qDebug() << "Begin downloading update files to" << m_updateFilesDir.path(); m_filesNetJob = netJob; - m_filesNetJob->start(m_network); + m_filesNetJob->start(); } void DownloadTask::fileDownloadFinished() diff --git a/launcher/updater/DownloadTask_test.cpp b/launcher/updater/DownloadTask_test.cpp index dc263c17..8e823a63 100644 --- a/launcher/updater/DownloadTask_test.cpp +++ b/launcher/updater/DownloadTask_test.cpp @@ -179,7 +179,8 @@ slots: OperationList operations; - processFileLists(currentVersion, newVersion, QDir::currentPath(), tempFolder, new NetJob("Dummy"), operations); + shared_qobject_ptr<QNetworkAccessManager> network = new QNetworkAccessManager(); + processFileLists(currentVersion, newVersion, QDir::currentPath(), tempFolder, new NetJob("Dummy", network), operations); qDebug() << (operations == expectedOperations); qDebug() << operations; qDebug() << expectedOperations; diff --git a/launcher/updater/UpdateChecker.cpp b/launcher/updater/UpdateChecker.cpp index c72bbe0b..efdb6093 100644 --- a/launcher/updater/UpdateChecker.cpp +++ b/launcher/updater/UpdateChecker.cpp @@ -104,11 +104,11 @@ void UpdateChecker::checkForUpdate(QString updateChannel, bool notifyNoUpdate) QUrl indexUrl = QUrl(m_newRepoUrl).resolved(QUrl("index.json")); - indexJob = new NetJob("GoUpdate Repository Index"); + indexJob = new NetJob("GoUpdate Repository Index", m_network); indexJob->addNetAction(Net::Download::makeByteArray(indexUrl, &indexData)); connect(indexJob.get(), &NetJob::succeeded, [this, notifyNoUpdate](){ updateCheckFinished(notifyNoUpdate); }); connect(indexJob.get(), &NetJob::failed, this, &UpdateChecker::updateCheckFailed); - indexJob->start(m_network); + indexJob->start(); } void UpdateChecker::updateCheckFinished(bool notifyNoUpdate) @@ -191,11 +191,11 @@ void UpdateChecker::updateChanList(bool notifyNoUpdate) } m_chanListLoading = true; - chanListJob = new NetJob("Update System Channel List"); + chanListJob = new NetJob("Update System Channel List", m_network); chanListJob->addNetAction(Net::Download::makeByteArray(QUrl(m_channelUrl), &chanlistData)); connect(chanListJob.get(), &NetJob::succeeded, [this, notifyNoUpdate]() { chanListDownloadFinished(notifyNoUpdate); }); connect(chanListJob.get(), &NetJob::failed, this, &UpdateChecker::chanListDownloadFailed); - chanListJob->start(m_network); + chanListJob->start(); } void UpdateChecker::chanListDownloadFinished(bool notifyNoUpdate) |