From: Roman Moravcik Date: Fri, 4 Mar 2011 08:16:26 +0000 (+0100) Subject: Implemented incremental retry download timer. X-Git-Tag: v0.1-1~2 X-Git-Url: https://vcs.maemo.org/git/?p=medard;a=commitdiff_plain;h=fe33c31a498c9ec3e1aa369c47acc064cc9b6ab4 Implemented incremental retry download timer. --- diff --git a/src/medarddownloader.cpp b/src/medarddownloader.cpp index 06f952f..6e8de0c 100644 --- a/src/medarddownloader.cpp +++ b/src/medarddownloader.cpp @@ -46,6 +46,7 @@ #define IMAGE_HEIGHT 408 #define MAX_DOWNLOAD_RETRIES 3 +#define RETRY_TIMEOUT 5000 MedardDownloader::MedardDownloader() : QObject() { @@ -59,7 +60,6 @@ MedardDownloader::MedardDownloader() : QObject() m_retryCounter = 0; m_retryTimer = new QTimer(); - m_retryTimer->setInterval(5000); connect(m_retryTimer, SIGNAL(timeout()), this, SLOT(retryTimerEvent())); m_cachePath = QString("%1/%2") @@ -191,6 +191,7 @@ void MedardDownloader::tryDownloadImageAgain() m_retryCounter++; if (m_retryCounter < MAX_DOWNLOAD_RETRIES) { + m_retryTimer->setInterval(RETRY_TIMEOUT * (m_retryCounter + 1)); m_retryTimer->start(); } else { m_retryCounter = 0;