Some reader improvements

* Log when VATSIM status file has been read
* fix: read VATSIM status file after initReaders completes
* some private slots -> normal private functions
* removed copy/paste error illegalIcaoCodes

follow up of Ref T105
This commit is contained in:
Klaus Basan
2017-07-11 20:38:06 +02:00
committed by Mathew Sutcliffe
parent 76b3b6c0b6
commit 880cedec5d
4 changed files with 40 additions and 34 deletions

View File

@@ -90,7 +90,6 @@ namespace BlackCore
return; // stop, terminate straight away, ending thread
}
QStringList illegalIcaoCodes;
if (nwReply->error() == QNetworkReply::NoError)
{
const QString dataFileData = nwReply->readAll();
@@ -145,7 +144,7 @@ namespace BlackCore
// cache itself is thread safe, avoid writing with unchanged data
CVatsimSetup vs(this->m_lastGoodSetup.get());
bool changed = vs.setUrls(dataFileUrls, serverFileUrls, metarFileUrls);
const bool changed = vs.setUrls(dataFileUrls, serverFileUrls, metarFileUrls);
if (changed)
{
vs.setUtcTimestamp(QDateTime::currentDateTime());
@@ -153,12 +152,6 @@ namespace BlackCore
if (cacheMsg.isFailure()) { CLogMessage::preformatted(cacheMsg); }
}
// warnings, if required
if (!illegalIcaoCodes.isEmpty())
{
CLogMessage(this).info("Illegal / ignored ICAO code(s) in VATSIM data file: %1") << illegalIcaoCodes.join(", ");
}
// data read finished
emit this->dataFileRead(lines.count());
emit this->dataRead(CEntityFlags::VatsimStatusFile, CEntityFlags::ReadFinished, lines.count());
@@ -166,7 +159,7 @@ namespace BlackCore
else
{
// network error
CLogMessage(this).warning("Reading VATSIM status file failed %1 %2") << nwReply->errorString() << nwReply->url().toString();
CLogMessage(this).warning("Reading VATSIM status file failed '%1' '%2'") << nwReply->errorString() << nwReply->url().toString();
nwReply->abort();
emit this->dataRead(CEntityFlags::VatsimStatusFile, CEntityFlags::ReadFailed, 0);
}