mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-16 18:35:35 +08:00
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:
committed by
Mathew Sutcliffe
parent
76b3b6c0b6
commit
880cedec5d
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user