diff options
author | Petr Mrázek <peterix@gmail.com> | 2017-04-29 02:24:00 +0200 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2017-04-29 02:24:00 +0200 |
commit | e1465f4848d003cab3d3d1288c1a0f3b945083ee (patch) | |
tree | 6721fbaac70aa39cb0f0dd75b75e8e6f87d42743 /api/logic/updater/DownloadTask.cpp | |
parent | 243f7e4fb4d58fa530404930566f83d1dc481588 (diff) | |
download | MultiMC-e1465f4848d003cab3d3d1288c1a0f3b945083ee.tar MultiMC-e1465f4848d003cab3d3d1288c1a0f3b945083ee.tar.gz MultiMC-e1465f4848d003cab3d3d1288c1a0f3b945083ee.tar.lz MultiMC-e1465f4848d003cab3d3d1288c1a0f3b945083ee.tar.xz MultiMC-e1465f4848d003cab3d3d1288c1a0f3b945083ee.zip |
NOISSUE refactor NetAction to be based on Task
Still missing some things, this is part 1.
Diffstat (limited to 'api/logic/updater/DownloadTask.cpp')
-rw-r--r-- | api/logic/updater/DownloadTask.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/api/logic/updater/DownloadTask.cpp b/api/logic/updater/DownloadTask.cpp index 0d40f78a..0d364bfc 100644 --- a/api/logic/updater/DownloadTask.cpp +++ b/api/logic/updater/DownloadTask.cpp @@ -26,7 +26,7 @@ namespace GoUpdate { -DownloadTask::DownloadTask(Status status, QString target, QObject *parent) +DownloadTask::DownloadTask(GoUpdate::Status status, QString target, QObject *parent) : Task(parent), m_updateFilesDir(target) { m_status = status; @@ -41,7 +41,7 @@ void DownloadTask::executeTask() void DownloadTask::loadVersionInfo() { - setStatus(tr("Loading version information...")); + setStatusText(tr("Loading version information...")); NetJob *netJob = new NetJob("Version Info"); @@ -70,7 +70,7 @@ void DownloadTask::vinfoDownloadFailed() { // Something failed. We really need the second download (current version info), so parse // downloads anyways as long as the first one succeeded. - if (m_newVersionFileListDownload->m_status != Job_Failed) + if (m_newVersionFileListDownload->m_status != Status::Failed) { processDownloadedVersionInfo(); return; @@ -86,7 +86,7 @@ void DownloadTask::processDownloadedVersionInfo() VersionFileList m_currentVersionFileList; VersionFileList m_newVersionFileList; - setStatus(tr("Reading file list for new version...")); + setStatusText(tr("Reading file list for new version...")); qDebug() << "Reading file list for new version..."; QString error; if (!parseVersionInfo(newVersionFileListData, m_newVersionFileList, error)) @@ -97,9 +97,9 @@ void DownloadTask::processDownloadedVersionInfo() } // if we have the current version info, use it. - if (m_currentVersionFileListDownload && m_currentVersionFileListDownload->m_status != Job_Failed) + if (m_currentVersionFileListDownload && m_currentVersionFileListDownload->m_status != Status::Failed) { - setStatus(tr("Reading file list for current version...")); + setStatusText(tr("Reading file list for current version...")); qDebug() << "Reading file list for current version..."; // if this fails, it's not a complete loss. QString error; @@ -114,7 +114,7 @@ void DownloadTask::processDownloadedVersionInfo() m_newVersionFileListDownload.reset(); m_vinfoNetJob.reset(); - setStatus(tr("Processing file lists - figuring out how to install the update...")); + setStatusText(tr("Processing file lists - figuring out how to install the update...")); // make a new netjob for the actual update files NetJobPtr netJob (new NetJob("Update Files")); @@ -131,7 +131,7 @@ void DownloadTask::processDownloadedVersionInfo() QObject::connect(netJob.get(), &NetJob::progress, this, &DownloadTask::fileDownloadProgressChanged); QObject::connect(netJob.get(), &NetJob::failed, this, &DownloadTask::fileDownloadFailed); - setStatus(tr("Downloading %1 update files.").arg(QString::number(netJob->size()))); + setStatusText(tr("Downloading %1 update files.").arg(QString::number(netJob->size()))); qDebug() << "Begin downloading update files to" << m_updateFilesDir.path(); m_filesNetJob = netJob; m_filesNetJob->start(); |