1
0
Fork 0
forked from len0rd/rockbox

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
This commit is contained in:
Dominik Riebeling 2010-04-01 22:06:49 +00:00
parent 44e4839366
commit 0d6828e064
2 changed files with 10 additions and 19 deletions

View file

@ -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);

View file

@ -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);