diff options
author | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2010-04-01 22:06:49 +0000 |
---|---|---|
committer | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2010-04-01 22:06:49 +0000 |
commit | 0d6828e064eee6c4bdac1dd9e9ce9bf522f9754a (patch) | |
tree | 7c76dd9df809c61b260dfee777b9836e0d04ab93 /rbutil/rbutilqt | |
parent | 44e48393665f5fdb0dbe93fdab5f9b94057ad658 (diff) |
Fix multiple warnings when network is unreachable.
Don't listen to requestFinished() signals for background downloads. The
only information needed is the done() signal. Fixes multiple error
messages popping up on unreachable network.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25430 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'rbutil/rbutilqt')
-rw-r--r-- | rbutil/rbutilqt/rbutilqt.cpp | 28 | ||||
-rw-r--r-- | rbutil/rbutilqt/rbutilqt.h | 1 |
2 files changed, 10 insertions, 19 deletions
diff --git a/rbutil/rbutilqt/rbutilqt.cpp b/rbutil/rbutilqt/rbutilqt.cpp index 739b7f42d0..575b381e3b 100644 --- a/rbutil/rbutilqt/rbutilqt.cpp +++ b/rbutil/rbutilqt/rbutilqt.cpp @@ -188,7 +188,6 @@ void RbUtilQt::downloadInfo() // try to get the current build information daily = new HttpGet(this); connect(daily, SIGNAL(done(bool)), this, SLOT(downloadDone(bool))); - connect(daily, SIGNAL(requestFinished(int, bool)), this, SLOT(downloadDone(int, bool))); connect(qApp, SIGNAL(lastWindowClosed()), daily, SLOT(abort())); if(RbSettings::value(RbSettings::CacheOffline).toBool()) daily->setCache(true); @@ -207,7 +206,9 @@ void RbUtilQt::downloadDone(bool error) qDebug() << "[RbUtil] network error:" << daily->error(); ui.statusbar->showMessage(tr("Can't get version information!")); QMessageBox::critical(this, tr("Network error"), - tr("Can't get version information.")); + tr("Can't get version information.\n" + "Network error: %1. Please check your network and proxy settings.") + .arg(daily->errorString())); return; } qDebug() << "[RbUtil] network status:" << daily->error(); @@ -217,10 +218,9 @@ void RbUtilQt::downloadDone(bool error) ServerInfo::readBuildInfo(buildInfo.fileName()); buildInfo.close(); - //start bleeding info download + // start bleeding info download bleeding = new HttpGet(this); connect(bleeding, SIGNAL(done(bool)), this, SLOT(downloadBleedingDone(bool))); - connect(bleeding, SIGNAL(requestFinished(int, bool)), this, SLOT(downloadDone(int, bool))); connect(qApp, SIGNAL(lastWindowClosed()), bleeding, SLOT(abort())); if(RbSettings::value(RbSettings::CacheOffline).toBool()) bleeding->setCache(true); @@ -235,6 +235,12 @@ void RbUtilQt::downloadBleedingDone(bool error) { if(error) { qDebug() << "[RbUtil] network error:" << bleeding->error(); + ui.statusbar->showMessage(tr("Can't get version information!")); + QMessageBox::critical(this, tr("Network error"), + tr("Can't get version information.\n" + "Network error: %1. Please check your network and proxy settings.") + .arg(bleeding->errorString())); + return; } else { bleedingInfo.open(); @@ -251,19 +257,6 @@ void RbUtilQt::downloadBleedingDone(bool error) } -void RbUtilQt::downloadDone(int id, bool error) -{ - QString errorString; - errorString = tr("Network error: %1. Please check your network and proxy settings.") - .arg(daily->errorString()); - if(error) { - QMessageBox::about(this, "Network Error", errorString); - m_networkerror = daily->errorString(); - } - qDebug() << "[RbUtil] downloadDone:" << id << "error:" << error; -} - - void RbUtilQt::about() { QDialog *window = new QDialog(this); @@ -1249,7 +1242,6 @@ void RbUtilQt::checkUpdate(void) update = new HttpGet(this); connect(update, SIGNAL(done(bool)), this, SLOT(downloadUpdateDone(bool))); - connect(update, SIGNAL(requestFinished(int, bool)), this, SLOT(downloadDone(int, bool))); connect(qApp, SIGNAL(lastWindowClosed()), update, SLOT(abort())); if(RbSettings::value(RbSettings::CacheOffline).toBool()) update->setCache(true); diff --git a/rbutil/rbutilqt/rbutilqt.h b/rbutil/rbutilqt/rbutilqt.h index afe8c5fd48..76747bca07 100644 --- a/rbutil/rbutilqt/rbutilqt.h +++ b/rbutil/rbutilqt/rbutilqt.h @@ -99,7 +99,6 @@ class RbUtilQt : public QMainWindow void createTalkFiles(void); void createVoiceFile(void); void downloadDone(bool); - void downloadDone(int, bool); void downloadBleedingDone(bool); void downloadInfo(void); |