diff options
author | kh1 <karsten.heimrich@nokia.com> | 2011-12-01 14:37:55 +0100 |
---|---|---|
committer | Karsten Heimrich <karsten.heimrich@nokia.com> | 2011-12-02 13:08:16 +0100 |
commit | 61362cf51a0894a00f972c2cb703ed9f1daa3594 (patch) | |
tree | 496d1c4327e0d5f4fbb61d0dfea801af8c3b2d98 /installerbuilder | |
parent | 2c8dddb5a346ee34a9134534763e9c6a276305cf (diff) |
If we cancel an download, prevent the failure msgbox.
Make sure to check for cancel in httpError, as the
error gets emited as soon as we call http abort in
cancelDownload(). Later in the chain httpDone would
reset m_canceled and cancelDownload would call httpDone
now with an unset m_canceled, resulting in emmiting an
error.
Change-Id: Ic1e74bef83706dba42ce8d2cb444c08078fa1ed8
Reviewed-by: Niels Weber <niels.2.weber@nokia.com>
Reviewed-by: Tim Jenssen <tim.jenssen@nokia.com>
Diffstat (limited to 'installerbuilder')
-rw-r--r-- | installerbuilder/libinstaller/3rdparty/kdtools/kdupdaterfiledownloader.cpp | 3 | ||||
-rw-r--r-- | installerbuilder/libinstaller/downloadarchivesjob.cpp | 5 |
2 files changed, 6 insertions, 2 deletions
diff --git a/installerbuilder/libinstaller/3rdparty/kdtools/kdupdaterfiledownloader.cpp b/installerbuilder/libinstaller/3rdparty/kdtools/kdupdaterfiledownloader.cpp index 4de001e12..fbb7b5d28 100644 --- a/installerbuilder/libinstaller/3rdparty/kdtools/kdupdaterfiledownloader.cpp +++ b/installerbuilder/libinstaller/3rdparty/kdtools/kdupdaterfiledownloader.cpp @@ -1163,7 +1163,8 @@ void KDUpdater::HttpDownloader::httpReadyRead() void KDUpdater::HttpDownloader::httpError(QNetworkReply::NetworkError) { - httpDone(true); + if (!d->aborted) + httpDone(true); } void KDUpdater::HttpDownloader::cancelDownload() diff --git a/installerbuilder/libinstaller/downloadarchivesjob.cpp b/installerbuilder/libinstaller/downloadarchivesjob.cpp index dbfb471f6..f0827dbe3 100644 --- a/installerbuilder/libinstaller/downloadarchivesjob.cpp +++ b/installerbuilder/libinstaller/downloadarchivesjob.cpp @@ -241,7 +241,7 @@ void DownloadArchivesJob::registerFile() } const QByteArray archiveHash = hash.result().toHex(); - if (archiveHash != m_currentHash) { + if ((archiveHash != m_currentHash) && (!m_canceled)) { //TODO: Maybe we should try to download the file again automatically const QMessageBox::Button res = MessageBoxHandler::critical(MessageBoxHandler::currentBestSuitParent(), @@ -276,6 +276,9 @@ void DownloadArchivesJob::downloadCanceled() void DownloadArchivesJob::downloadFailed(const QString &error) { + if (m_canceled) + return; + const QMessageBox::StandardButton b = MessageBoxHandler::critical(MessageBoxHandler::currentBestSuitParent(), QLatin1String("archiveDownloadError"), tr("Download Error"), tr("Could not download archive: %1 : %2") |