diff options
author | Petr Mrázek <peterix@gmail.com> | 2015-04-26 13:47:14 +0200 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2015-04-26 18:33:29 +0200 |
commit | 84549ed8078bdbd029aa5a89facc0412b8b5e753 (patch) | |
tree | 3a5bd2727195f18c42cdb428421cab5fc6562d9d /logic/updater | |
parent | d5c79db12c326bd0175cd2990764948a536abbbb (diff) | |
download | MultiMC-84549ed8078bdbd029aa5a89facc0412b8b5e753.tar MultiMC-84549ed8078bdbd029aa5a89facc0412b8b5e753.tar.gz MultiMC-84549ed8078bdbd029aa5a89facc0412b8b5e753.tar.lz MultiMC-84549ed8078bdbd029aa5a89facc0412b8b5e753.tar.xz MultiMC-84549ed8078bdbd029aa5a89facc0412b8b5e753.zip |
GH-849 Further NetJob related fixes
Diffstat (limited to 'logic/updater')
-rw-r--r-- | logic/updater/DownloadTask.cpp | 7 | ||||
-rw-r--r-- | logic/updater/DownloadTask.h | 2 | ||||
-rw-r--r-- | logic/updater/UpdateChecker.cpp | 6 | ||||
-rw-r--r-- | logic/updater/UpdateChecker.h | 2 |
4 files changed, 8 insertions, 9 deletions
diff --git a/logic/updater/DownloadTask.cpp b/logic/updater/DownloadTask.cpp index 65d894f9..f19607a5 100644 --- a/logic/updater/DownloadTask.cpp +++ b/logic/updater/DownloadTask.cpp @@ -159,11 +159,10 @@ void DownloadTask::fileDownloadFinished() emitSucceeded(); } -void DownloadTask::fileDownloadFailed() +void DownloadTask::fileDownloadFailed(QString reason) { - // TODO: Give more info about the failure. - qCritical() << "Failed to download update files."; - emitFailed(tr("Failed to download update files.")); + qCritical() << "Failed to download update files:" << reason; + emitFailed(tr("Failed to download update files: %1").arg(reason)); } void DownloadTask::fileDownloadProgressChanged(qint64 current, qint64 total) diff --git a/logic/updater/DownloadTask.h b/logic/updater/DownloadTask.h index 24e39415..182e76d6 100644 --- a/logic/updater/DownloadTask.h +++ b/logic/updater/DownloadTask.h @@ -78,7 +78,7 @@ protected slots: void vinfoDownloadFailed(); void fileDownloadFinished(); - void fileDownloadFailed(); + void fileDownloadFailed(QString reason); void fileDownloadProgressChanged(qint64 current, qint64 total); }; diff --git a/logic/updater/UpdateChecker.cpp b/logic/updater/UpdateChecker.cpp index 7d214ed4..1cdac916 100644 --- a/logic/updater/UpdateChecker.cpp +++ b/logic/updater/UpdateChecker.cpp @@ -96,7 +96,7 @@ void UpdateChecker::checkForUpdate(QString updateChannel, bool notifyNoUpdate) job->addNetAction(ByteArrayDownload::make(indexUrl)); connect(job, &NetJob::succeeded, [this, notifyNoUpdate]() { updateCheckFinished(notifyNoUpdate); }); - connect(job, SIGNAL(failed()), SLOT(updateCheckFailed())); + connect(job, &NetJob::failed, this, &UpdateChecker::updateCheckFailed); indexJob.reset(job); job->start(); } @@ -260,10 +260,10 @@ void UpdateChecker::chanListDownloadFinished(bool notifyNoUpdate) emit channelListLoaded(); } -void UpdateChecker::chanListDownloadFailed() +void UpdateChecker::chanListDownloadFailed(QString reason) { m_chanListLoading = false; - qCritical() << "Failed to download channel list."; + qCritical() << QString("Failed to download channel list: %1").arg(reason); emit channelListLoaded(); } diff --git a/logic/updater/UpdateChecker.h b/logic/updater/UpdateChecker.h index 760245cd..39ccd138 100644 --- a/logic/updater/UpdateChecker.h +++ b/logic/updater/UpdateChecker.h @@ -70,7 +70,7 @@ private slots: void updateCheckFailed(); void chanListDownloadFinished(bool notifyNoUpdate); - void chanListDownloadFailed(); + void chanListDownloadFailed(QString reason); private: friend class UpdateCheckerTest; |