Correct Zeo data download : only one message box after new values

This commit is contained in:
Damien
2012-11-27 22:07:46 +01:00
parent b05c6cca61
commit 32783685ff
2 changed files with 10 additions and 10 deletions

View File

@@ -108,15 +108,14 @@ ZeoDownload::downloadFinished(QNetworkReply *reply)
dates.removeFirst();
}
nextDate();
QString status = QString(tr("%1 new on %2 measurements received.")).arg(newMeasures).arg(allMeasures);
QMessageBox::information(main, tr("Zeo Data Download"), status);
if (!nextDate()) {
QString status = QString(tr("%1 new on %2 measurements received.")).arg(newMeasures).arg(allMeasures);
QMessageBox::information(main, tr("Zeo Data Download"), status);
}
return;
}
void
bool
ZeoDownload::nextDate()
{
if (!dates.empty()) {
@@ -131,7 +130,7 @@ ZeoDownload::nextDate()
if (sm.getText("Sleep time", "").length()>0 && sm.getText("Sleep index (ZQ)", "").length()>0) {
present = true;
dates.removeFirst();
nextDate();
return nextDate();
}
}
@@ -148,9 +147,10 @@ ZeoDownload::nextDate()
if (reply->error() != QNetworkReply::NoError) {
QMessageBox::warning(main, tr("Zeo Data Download"), reply->errorString());
}
} else
return true;
}
}
return;
return false;
}

View File

@@ -55,6 +55,6 @@ private:
int allMeasures;
int newMeasures;
void nextDate();
bool nextDate();
};
#endif