mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-16 18:35:35 +08:00
Ref T485 Adjust CLogMessage and CStatusMessage call sites to use the new API.
This commit is contained in:
@@ -74,13 +74,13 @@ namespace BlackCore
|
||||
const QDir directory(dir);
|
||||
if (!directory.exists())
|
||||
{
|
||||
return CStatusMessage(this).error("Missing directory '%1'") << dir;
|
||||
return CStatusMessage(this).error(u"Missing directory '%1'") << dir;
|
||||
}
|
||||
|
||||
whatToRead &= CEntityFlags::AirportEntity; // can handle these entities
|
||||
if (whatToRead == CEntityFlags::NoEntity)
|
||||
{
|
||||
return CStatusMessage(this).info("'%1' No entity for this reader") << CEntityFlags::flagToString(whatToRead);
|
||||
return CStatusMessage(this).info(u"'%1' No entity for this reader") << CEntityFlags::flagToString(whatToRead);
|
||||
}
|
||||
|
||||
int c = 0;
|
||||
@@ -91,7 +91,7 @@ namespace BlackCore
|
||||
const QFileInfo fi(fileName);
|
||||
if (!fi.exists())
|
||||
{
|
||||
msgs.push_back(CStatusMessage(this).warning("File '%1' does not exist") << fileName);
|
||||
msgs.push_back(CStatusMessage(this).warning(u"File '%1' does not exist") << fileName);
|
||||
}
|
||||
else if (!this->overrideCacheFromFile(overrideNewerOnly, fi, CEntityFlags::AirportEntity, msgs))
|
||||
{
|
||||
@@ -227,7 +227,7 @@ namespace BlackCore
|
||||
qint64 latestTimestamp = airports.latestTimestampMsecsSinceEpoch();
|
||||
if (size > 0 && latestTimestamp < 0)
|
||||
{
|
||||
CLogMessage(this).error("No timestamp in airport list, setting to last modified value");
|
||||
CLogMessage(this).error(u"No timestamp in airport list, setting to last modified value");
|
||||
latestTimestamp = lastModifiedMsSinceEpoch(nwReply.data());
|
||||
}
|
||||
|
||||
|
||||
@@ -60,18 +60,18 @@ namespace BlackCore
|
||||
|
||||
emit this->consolidating(true);
|
||||
int cycle = m_cycle;
|
||||
this->addHistory(CLogMessage(this).info("Background consolidation cycle %1") << cycle);
|
||||
this->addHistory(CLogMessage(this).info(u"Background consolidation cycle %1") << cycle);
|
||||
|
||||
switch (cycle)
|
||||
{
|
||||
case 0:
|
||||
// normally redundant, will be read in other places as well
|
||||
// new metadata for next comparison
|
||||
this->addHistory(CLogMessage(this).info("Triggered info reads from DB"));
|
||||
this->addHistory(CLogMessage(this).info(u"Triggered info reads from DB"));
|
||||
this->triggerInfoReads();
|
||||
break;
|
||||
case 1:
|
||||
this->addHistory(CLogMessage(this).info("Synchronize DB entities"));
|
||||
this->addHistory(CLogMessage(this).info(u"Synchronize DB entities"));
|
||||
this->syncDbEntity(CEntityFlags::AirlineIcaoEntity);
|
||||
this->syncDbEntity(CEntityFlags::LiveryEntity);
|
||||
this->syncDbEntity(CEntityFlags::ModelEntity);
|
||||
@@ -79,11 +79,11 @@ namespace BlackCore
|
||||
this->syncDbEntity(CEntityFlags::AircraftIcaoEntity);
|
||||
break;
|
||||
case 2:
|
||||
this->addHistory(CLogMessage(this).info("Synchronize %1") << this->modelCaches(true).getDescription());
|
||||
this->addHistory(CLogMessage(this).info(u"Synchronize %1") << this->modelCaches(true).getDescription());
|
||||
this->syncModelOrModelSetCacheWithDbData(true); // set
|
||||
break;
|
||||
case 3:
|
||||
this->addHistory(CLogMessage(this).info("Synchronize %1") << this->modelCaches(false).getDescription());
|
||||
this->addHistory(CLogMessage(this).info(u"Synchronize %1") << this->modelCaches(false).getDescription());
|
||||
this->syncModelOrModelSetCacheWithDbData(false);
|
||||
break;
|
||||
default:
|
||||
@@ -142,13 +142,13 @@ namespace BlackCore
|
||||
{
|
||||
const CStatusMessage m = modelCaches.setCachedModels(simulatorModels, singleSimulator);
|
||||
const int msElapsed = time.elapsed();
|
||||
this->addHistory(CLogMessage(this).info("Consolidated %1 models (%2) for '%3' in %4ms") << c << description << singleSimulator.convertToQString() << msElapsed);
|
||||
this->addHistory(CLogMessage(this).info(u"Consolidated %1 models (%2) for '%3' in %4ms") << c << description << singleSimulator.convertToQString() << msElapsed);
|
||||
CLogMessage::preformatted(m);
|
||||
this->addHistory(m);
|
||||
}
|
||||
else
|
||||
{
|
||||
this->addHistory(CLogMessage(this).info("Synchronized, no changes for '%1'") << singleSimulator.convertToQString());
|
||||
this->addHistory(CLogMessage(this).info(u"Synchronized, no changes for '%1'") << singleSimulator.convertToQString());
|
||||
}
|
||||
|
||||
if (simulatorsSet.size() > 1)
|
||||
@@ -173,12 +173,12 @@ namespace BlackCore
|
||||
if (!latestDbTs.isValid()) { return; }
|
||||
if (latestDbTs <= latestCacheTs)
|
||||
{
|
||||
this->addHistory(CLogMessage(this).info("Background updater (%1), no auto synchronization with DB, entity '%2', DB ts: %3 cache ts: %4")
|
||||
this->addHistory(CLogMessage(this).info(u"Background updater (%1), no auto synchronization with DB, entity '%2', DB ts: %3 cache ts: %4")
|
||||
<< CThreadUtils::currentThreadInfo() << entityStr << latestDbTs.toString(Qt::ISODate) << latestCacheTsStr);
|
||||
return;
|
||||
}
|
||||
|
||||
this->addHistory(CLogMessage(this).info("Background updater (%1) triggering read of '%2' since '%3'")
|
||||
this->addHistory(CLogMessage(this).info(u"Background updater (%1) triggering read of '%2' since '%3'")
|
||||
<< CThreadUtils::currentThreadInfo() << entityStr << latestCacheTsStr);
|
||||
sApp->getWebDataServices()->triggerLoadingDirectlyFromDb(entity, latestCacheTs);
|
||||
}
|
||||
|
||||
@@ -123,12 +123,12 @@ namespace BlackCore
|
||||
const QString json(nwReply->readAll().trimmed());
|
||||
if (json.isEmpty())
|
||||
{
|
||||
CLogMessage(this).error("Authentication failed, no response from '%1'") << urlString;
|
||||
CLogMessage(this).error(u"Authentication failed, no response from '%1'") << urlString;
|
||||
return;
|
||||
}
|
||||
if (!Json::looksLikeJson(json))
|
||||
{
|
||||
CLogMessage(this).error("Illegal JSON object: %1") << CNetworkUtils::removeHtmlPartsFromPhpErrorMessage(json);
|
||||
CLogMessage(this).error(u"Illegal JSON object: %1") << CNetworkUtils::removeHtmlPartsFromPhpErrorMessage(json);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -165,7 +165,7 @@ namespace BlackCore
|
||||
}
|
||||
else
|
||||
{
|
||||
CLogMessage(this).error("Authentication failed, %1") << nwReply->errorString();
|
||||
CLogMessage(this).error(u"Authentication failed, %1") << nwReply->errorString();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@ namespace BlackCore
|
||||
{
|
||||
this->admitCaches(currentEntity);
|
||||
cachedEntities |= currentEntity; // read from cache
|
||||
CLogMessage(this).info("Using cache for '%1' (%2, %3)") << currentEntityName << cacheTs.toString() << cacheTimestamp;
|
||||
CLogMessage(this).info(u"Using cache for '%1' (%2, %3)") << currentEntityName << cacheTs.toString() << cacheTimestamp;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -109,23 +109,23 @@ namespace BlackCore
|
||||
|
||||
if (changedUrl)
|
||||
{
|
||||
CLogMessage(this).info("Data location for '%1' changed ('%2'->'%3'), will override cache for reading '%4'")
|
||||
CLogMessage(this).info(u"Data location for '%1' changed ('%2'->'%3'), will override cache for reading '%4'")
|
||||
<< currentEntityName << oldUrlInfo.toQString()
|
||||
<< newUrlInfo.toQString() << rmDbOrSharedFlagString;
|
||||
}
|
||||
else
|
||||
{
|
||||
CLogMessage(this).info("Cache for '%1' outdated, latest entity (%2, %3), reading '%4'") << currentEntityName << latestEntityTs.toString() << latestEntityTimestamp << rmDbOrSharedFlagString;
|
||||
CLogMessage(this).info(u"Cache for '%1' outdated, latest entity (%2, %3), reading '%4'") << currentEntityName << latestEntityTs.toString() << latestEntityTimestamp << rmDbOrSharedFlagString;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!rmDbReadingOrShared) { CLogMessage(this).info("No DB or shared reading for '%1', read mode is: '%2'") << currentEntityName << rmString; }
|
||||
if (!hasDbInfoObjects) { CLogMessage(this).info("No DB info objects for '%1', read mode is: '%2'") << currentEntityName << rmString; }
|
||||
if (!rmDbReadingOrShared) { CLogMessage(this).info(u"No DB or shared reading for '%1', read mode is: '%2'") << currentEntityName << rmString; }
|
||||
if (!hasDbInfoObjects) { CLogMessage(this).info(u"No DB info objects for '%1', read mode is: '%2'") << currentEntityName << rmString; }
|
||||
if (currentEntityCount > 0)
|
||||
{
|
||||
CLogMessage(this).info("Cache for '%1' already read, %2 entries") << currentEntityName << currentEntityCount;
|
||||
CLogMessage(this).info(u"Cache for '%1' already read, %2 entries") << currentEntityName << currentEntityCount;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -134,12 +134,12 @@ namespace BlackCore
|
||||
if (!rmDbReadingOrShared)
|
||||
{
|
||||
// intentionally we do not want to read from DB/shared
|
||||
CLogMessage(this).info("Triggered reading cache for '%1', read mode: %2") << currentEntityName << rmString;
|
||||
CLogMessage(this).info(u"Triggered reading cache for '%1', read mode: %2") << currentEntityName << rmString;
|
||||
}
|
||||
else
|
||||
{
|
||||
// we want to read from DB/shared, but have no info object
|
||||
CLogMessage(this).info("No info object for '%1', triggered reading cache, read mode: %2") << currentEntityName << rmString;
|
||||
CLogMessage(this).info(u"No info object for '%1', triggered reading cache, read mode: %2") << currentEntityName << rmString;
|
||||
}
|
||||
}
|
||||
cachedEntities |= currentEntity; // read from cache
|
||||
@@ -164,14 +164,14 @@ namespace BlackCore
|
||||
// Real read from DB
|
||||
if (dbEntities != CEntityFlags::NoEntity)
|
||||
{
|
||||
CLogMessage(this).info("Start reading DB entities: %1") << CEntityFlags::flagToString(dbEntities);
|
||||
CLogMessage(this).info(u"Start reading DB entities: %1") << CEntityFlags::flagToString(dbEntities);
|
||||
this->startReadFromBackendInBackgroundThread(dbEntities, CDbFlags::DbReading, newerThan);
|
||||
}
|
||||
|
||||
// Real read from shared
|
||||
if (sharedEntities != CEntityFlags::NoEntity)
|
||||
{
|
||||
CLogMessage(this).info("Start reading shared entities: %1") << CEntityFlags::flagToString(sharedEntities);
|
||||
CLogMessage(this).info(u"Start reading shared entities: %1") << CEntityFlags::flagToString(sharedEntities);
|
||||
this->startReadFromBackendInBackgroundThread(dbEntities, CDbFlags::Shared, newerThan);
|
||||
}
|
||||
}
|
||||
@@ -191,7 +191,7 @@ namespace BlackCore
|
||||
if (newerHeaderEntities != entities)
|
||||
{
|
||||
const CEntityFlags::Entity validInCacheEntities = (entities ^ newerHeaderEntities) & entities;
|
||||
CLogMessage(this).info("Reduced '%1' to '%2' before triggering load of shared files (still in cache)") << CEntityFlags::flagToString(entities) << CEntityFlags::flagToString(newerHeaderEntities);
|
||||
CLogMessage(this).info(u"Reduced '%1' to '%2' before triggering load of shared files (still in cache)") << CEntityFlags::flagToString(entities) << CEntityFlags::flagToString(newerHeaderEntities);
|
||||
|
||||
// In case we have difference entities we treat them as they were loaded, they result from still being in the cache
|
||||
// Using timer to first finish this function, then the resulting signal
|
||||
@@ -394,7 +394,7 @@ namespace BlackCore
|
||||
const CUrl urlSharedDbdata = CDatabaseReader::getWorkingSharedDbdataDirectoryUrl();
|
||||
if (urlSharedDbdata.isEmpty())
|
||||
{
|
||||
CLogMessage(this).warning("No working shared URL, cannot request headers");
|
||||
CLogMessage(this).warning(u"No working shared URL, cannot request headers");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -407,7 +407,7 @@ namespace BlackCore
|
||||
url.appendPath(fileName);
|
||||
|
||||
const QString entityString = CEntityFlags::flagToString(currentEntity);
|
||||
CLogMessage(this).info("Triggered read of header for shared file of '%1'") << entityString;
|
||||
CLogMessage(this).info(u"Triggered read of header for shared file of '%1'") << entityString;
|
||||
const QNetworkReply *reply = sApp->headerFromNetwork(url, { this, &CDatabaseReader::receivedSharedFileHeader });
|
||||
if (reply) { c++; }
|
||||
currentEntity = CEntityFlags::iterateDbEntities(allEntities);
|
||||
@@ -497,7 +497,7 @@ namespace BlackCore
|
||||
{
|
||||
// never emit when lock is held, deadlock
|
||||
Q_ASSERT_X(CEntityFlags::isSingleEntity(entity), Q_FUNC_INFO, "Expect single entity");
|
||||
CLogMessage(this).info("Read %1 entities of '%2' from '%3' (%4)") << number << CEntityFlags::flagToString(entity) << res.getUrlString() << res.getLoadTimeStringWithStartedHint();
|
||||
CLogMessage(this).info(u"Read %1 entities of '%2' from '%3' (%4)") << number << CEntityFlags::flagToString(entity) << res.getUrlString() << res.getLoadTimeStringWithStartedHint();
|
||||
emit this->dataRead(entity, res.isRestricted() ? CEntityFlags::ReadFinishedRestricted : CEntityFlags::ReadFinished, number);
|
||||
}
|
||||
|
||||
@@ -553,7 +553,7 @@ namespace BlackCore
|
||||
const CEntityFlags::Entity entity = CEntityFlags::singleEntityByName(fileName);
|
||||
m_sharedFileResponses[entity] = headerResponse;
|
||||
|
||||
CLogMessage(this).info("Received header for shared file of '%1' from '%2'") << fileName << headerResponse.getUrl().toQString();
|
||||
CLogMessage(this).info(u"Received header for shared file of '%1' from '%2'") << fileName << headerResponse.getUrl().toQString();
|
||||
emit this->sharedFileHeaderRead(entity, fileName, !headerResponse.hasWarningOrAboveMessage());
|
||||
}
|
||||
|
||||
@@ -618,8 +618,8 @@ namespace BlackCore
|
||||
{
|
||||
const bool s = this->readFromJsonFilesInBackground(CDirectoryUtils::staticDbFilesDirectory(), entities, overrideNewerOnly);
|
||||
return s ?
|
||||
CStatusMessage(this).info("Started reading in background from '%1' of entities: '%2'") << CDirectoryUtils::staticDbFilesDirectory() << CEntityFlags::flagToString(entities) :
|
||||
CStatusMessage(this).error("Starting reading in background from '%1' of entities: '%2' failed") << CDirectoryUtils::staticDbFilesDirectory() << CEntityFlags::flagToString(entities);
|
||||
CStatusMessage(this).info(u"Started reading in background from '%1' of entities: '%2'") << CDirectoryUtils::staticDbFilesDirectory() << CEntityFlags::flagToString(entities) :
|
||||
CStatusMessage(this).error(u"Starting reading in background from '%1' of entities: '%2' failed") << CDirectoryUtils::staticDbFilesDirectory() << CEntityFlags::flagToString(entities);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -657,19 +657,19 @@ namespace BlackCore
|
||||
const qint64 cacheTs = cacheDateTime.toUTC().toMSecsSinceEpoch();
|
||||
if (fileTs > cacheTs)
|
||||
{
|
||||
msgs.push_back(CStatusMessage(this).info("File '%1' is newer than cache (%2)") << fileInfo.absoluteFilePath() << cacheDateTime.toUTC().toString());
|
||||
msgs.push_back(CStatusMessage(this).info(u"File '%1' is newer than cache (%2)") << fileInfo.absoluteFilePath() << cacheDateTime.toUTC().toString());
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
msgs.push_back(CStatusMessage(this).info("File '%1' is not newer than cache (%2)") << fileInfo.absoluteFilePath() << cacheDateTime.toUTC().toString());
|
||||
msgs.push_back(CStatusMessage(this).info(u"File '%1' is not newer than cache (%2)") << fileInfo.absoluteFilePath() << cacheDateTime.toUTC().toString());
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
void CDatabaseReader::logParseMessage(const QString &entity, int size, int msElapsed, const CDatabaseReader::JsonDatastoreResponse &response) const
|
||||
{
|
||||
CLogMessage(this).info("Parsed %1 %2 in %3ms, thread %4 | '%5'")
|
||||
CLogMessage(this).info(u"Parsed %1 %2 in %3ms, thread %4 | '%5'")
|
||||
<< size << entity << msElapsed
|
||||
<< CThreadUtils::currentThreadInfo() << response.toQString();
|
||||
}
|
||||
|
||||
@@ -197,7 +197,7 @@ namespace BlackCore
|
||||
consolidatedModels.push_back(model);
|
||||
}
|
||||
}
|
||||
CLogMessage(static_cast<CDatabaseUtils *>(nullptr)).info("Consolidated %1 vs. %2 in %3 ms") << models.size() << simulatorModels.size() << timer.elapsed() << "ms";
|
||||
CLogMessage(static_cast<CDatabaseUtils *>(nullptr)).info(u"Consolidated %1 vs. %2 in %3 ms") << models.size() << simulatorModels.size() << timer.elapsed() << "ms";
|
||||
return consolidatedModels;
|
||||
}
|
||||
|
||||
@@ -218,7 +218,7 @@ namespace BlackCore
|
||||
if (processEvents && c % 125 == 0) { sApp->processEventsFor(25); }
|
||||
}
|
||||
}
|
||||
CLogMessage(static_cast<CDatabaseUtils *>(nullptr)).info("Consolidated %1 models in %2ms") << models.size() << timer.elapsed();
|
||||
CLogMessage(static_cast<CDatabaseUtils *>(nullptr)).info(u"Consolidated %1 models in %2ms") << models.size() << timer.elapsed();
|
||||
return c;
|
||||
}
|
||||
|
||||
@@ -242,7 +242,7 @@ namespace BlackCore
|
||||
model = consolidated;
|
||||
c++;
|
||||
}
|
||||
CLogMessage(static_cast<CDatabaseUtils *>(nullptr)).info("Consolidated %1 models in %2 ms") << simulatorModels.size() << timer.elapsed();
|
||||
CLogMessage(static_cast<CDatabaseUtils *>(nullptr)).info(u"Consolidated %1 models in %2 ms") << simulatorModels.size() << timer.elapsed();
|
||||
return c;
|
||||
}
|
||||
|
||||
@@ -340,7 +340,7 @@ namespace BlackCore
|
||||
stashModels.push_back(dbModel); // changed DB model
|
||||
if (updateInfo)
|
||||
{
|
||||
const CStatusMessage m = CStatusMessage(getLogCategories()).info("%1 -> %2 (%3) for '%4'")
|
||||
const CStatusMessage m = CStatusMessage(getLogCategories()).info(u"%1 -> %2 (%3) for '%4'")
|
||||
<< dbModelSimulator.toQString(true) << simulator.toQString(true)
|
||||
<< delta.toQString(true) << dbModel.getModelStringAndDbKey();
|
||||
updateInfo->push_back(m);
|
||||
|
||||
@@ -300,7 +300,7 @@ namespace BlackCore
|
||||
qint64 latestTimestamp = codes.latestTimestampMsecsSinceEpoch(); // ignores duplicates
|
||||
if (n > 0 && latestTimestamp < 0)
|
||||
{
|
||||
CLogMessage(this).error("No timestamp in aircraft ICAO list, setting to last modified value");
|
||||
CLogMessage(this).error(u"No timestamp in aircraft ICAO list, setting to last modified value");
|
||||
latestTimestamp = this->lastModifiedMsSinceEpoch(nwReply.data());
|
||||
}
|
||||
|
||||
@@ -354,7 +354,7 @@ namespace BlackCore
|
||||
qint64 latestTimestamp = codes.latestTimestampMsecsSinceEpoch();
|
||||
if (n > 0 && latestTimestamp < 0)
|
||||
{
|
||||
CLogMessage(this).error("No timestamp in airline ICAO list, setting to last modified value");
|
||||
CLogMessage(this).error(u"No timestamp in airline ICAO list, setting to last modified value");
|
||||
latestTimestamp = this->lastModifiedMsSinceEpoch(nwReply.data());
|
||||
}
|
||||
|
||||
@@ -398,7 +398,7 @@ namespace BlackCore
|
||||
qint64 latestTimestamp = countries.latestTimestampMsecsSinceEpoch();
|
||||
if (n > 0 && latestTimestamp < 0)
|
||||
{
|
||||
CLogMessage(this).error("No timestamp in country list, setting to last modified value");
|
||||
CLogMessage(this).error(u"No timestamp in country list, setting to last modified value");
|
||||
latestTimestamp = this->lastModifiedMsSinceEpoch(nwReply.data());
|
||||
}
|
||||
|
||||
@@ -413,7 +413,7 @@ namespace BlackCore
|
||||
const QDir directory(dir);
|
||||
if (!directory.exists())
|
||||
{
|
||||
return CStatusMessage(this).error("Missing directory '%1'") << dir;
|
||||
return CStatusMessage(this).error(u"Missing directory '%1'") << dir;
|
||||
}
|
||||
|
||||
// Hint: Do not emit while locked -> deadlock
|
||||
@@ -426,7 +426,7 @@ namespace BlackCore
|
||||
const QFileInfo fi(fileName);
|
||||
if (!fi.exists())
|
||||
{
|
||||
msgs.push_back(CStatusMessage(this).warning("File '%1' does not exist") << fileName);
|
||||
msgs.push_back(CStatusMessage(this).warning(u"File '%1' does not exist") << fileName);
|
||||
}
|
||||
else if (!this->overrideCacheFromFile(overrideNewerOnly, fi, CEntityFlags::CountryEntity, msgs))
|
||||
{
|
||||
@@ -437,7 +437,7 @@ namespace BlackCore
|
||||
const QJsonObject countriesJson(CDatabaseUtils::readQJsonObjectFromDatabaseFile(fileName));
|
||||
if (countriesJson.isEmpty())
|
||||
{
|
||||
msgs.push_back(CStatusMessage(this).error("Failed to read from file/empty file '%1'") << fileName);
|
||||
msgs.push_back(CStatusMessage(this).error(u"Failed to read from file/empty file '%1'") << fileName);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -464,7 +464,7 @@ namespace BlackCore
|
||||
const QFileInfo fi(fileName);
|
||||
if (!fi.exists())
|
||||
{
|
||||
msgs.push_back(CStatusMessage(this).warning("File '%1' does not exist") << fileName);
|
||||
msgs.push_back(CStatusMessage(this).warning(u"File '%1' does not exist") << fileName);
|
||||
}
|
||||
else if (!this->overrideCacheFromFile(overrideNewerOnly, fi, CEntityFlags::AircraftIcaoEntity, msgs))
|
||||
{
|
||||
@@ -475,7 +475,7 @@ namespace BlackCore
|
||||
const QJsonObject aircraftJson(CDatabaseUtils::readQJsonObjectFromDatabaseFile(fileName));
|
||||
if (aircraftJson.isEmpty())
|
||||
{
|
||||
msgs.push_back(CStatusMessage(this).error("Failed to read from file/empty file '%1'") << fileName);
|
||||
msgs.push_back(CStatusMessage(this).error(u"Failed to read from file/empty file '%1'") << fileName);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -502,7 +502,7 @@ namespace BlackCore
|
||||
const QFileInfo fi(fileName);
|
||||
if (!fi.exists())
|
||||
{
|
||||
msgs.push_back(CStatusMessage(this).warning("File '%1' does not exist") << fileName);
|
||||
msgs.push_back(CStatusMessage(this).warning(u"File '%1' does not exist") << fileName);
|
||||
}
|
||||
else if (!this->overrideCacheFromFile(overrideNewerOnly, fi, CEntityFlags::AirlineIcaoEntity, msgs))
|
||||
{
|
||||
@@ -513,7 +513,7 @@ namespace BlackCore
|
||||
const QJsonObject airlineJson(CDatabaseUtils::readQJsonObjectFromDatabaseFile(fileName));
|
||||
if (airlineJson.isEmpty())
|
||||
{
|
||||
msgs.push_back(CStatusMessage(this).error("Failed to read from file/empty file '%1'") << fileName);
|
||||
msgs.push_back(CStatusMessage(this).error(u"Failed to read from file/empty file '%1'") << fileName);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -146,7 +146,7 @@ namespace BlackCore
|
||||
|
||||
if (urlLogList.hasPending())
|
||||
{
|
||||
CLogMessage(this).info("Info data reading still pending, summary: '%1'") << urlLogList.getSummary();
|
||||
CLogMessage(this).info(u"Info data reading still pending, summary: '%1'") << urlLogList.getSummary();
|
||||
return;
|
||||
}
|
||||
if (!url.isEmpty())
|
||||
@@ -229,7 +229,7 @@ namespace BlackCore
|
||||
Q_UNUSED(overrideNewer);
|
||||
Q_ASSERT_X(false, Q_FUNC_INFO, "Not supported");
|
||||
|
||||
return CStatusMessage(this).error("Not supported");
|
||||
return CStatusMessage(this).error(u"Not supported");
|
||||
}
|
||||
|
||||
bool CInfoDataReader::readFromJsonFilesInBackground(const QString &dir, CEntityFlags::Entity whatToRead, bool overrideNewer)
|
||||
|
||||
@@ -310,7 +310,7 @@ namespace BlackCore
|
||||
qint64 latestTimestamp = liveries.latestTimestampMsecsSinceEpoch();
|
||||
if (n > 0 && latestTimestamp < 0)
|
||||
{
|
||||
CLogMessage(this).error("No timestamp in livery list, setting to last modified value");
|
||||
CLogMessage(this).error(u"No timestamp in livery list, setting to last modified value");
|
||||
latestTimestamp = lastModifiedMsSinceEpoch(nwReply.data());
|
||||
}
|
||||
const CStatusMessage cacheMsg = m_liveryCache.set(liveries, latestTimestamp);
|
||||
@@ -357,7 +357,7 @@ namespace BlackCore
|
||||
qint64 latestTimestamp = distributors.latestTimestampMsecsSinceEpoch();
|
||||
if (n > 0 && latestTimestamp < 0)
|
||||
{
|
||||
CLogMessage(this).error("No timestamp in distributor list, setting to last modified value");
|
||||
CLogMessage(this).error(u"No timestamp in distributor list, setting to last modified value");
|
||||
latestTimestamp = lastModifiedMsSinceEpoch(nwReply.data());
|
||||
}
|
||||
|
||||
@@ -406,7 +406,7 @@ namespace BlackCore
|
||||
qint64 latestTimestamp = models.latestTimestampMsecsSinceEpoch();
|
||||
if (n > 0 && latestTimestamp < 0)
|
||||
{
|
||||
CLogMessage(this).error("No timestamp in model list, setting to last modified value");
|
||||
CLogMessage(this).error(u"No timestamp in model list, setting to last modified value");
|
||||
latestTimestamp = lastModifiedMsSinceEpoch(nwReply.data());
|
||||
}
|
||||
const CStatusMessage cacheMsg = m_modelCache.set(models, latestTimestamp);
|
||||
@@ -421,7 +421,7 @@ namespace BlackCore
|
||||
const QDir directory(dir);
|
||||
if (!directory.exists())
|
||||
{
|
||||
return CStatusMessage(this).error("Missing directory '%1'") << dir;
|
||||
return CStatusMessage(this).error(u"Missing directory '%1'") << dir;
|
||||
}
|
||||
|
||||
whatToRead &= CEntityFlags::DistributorLiveryModel; // supported
|
||||
@@ -434,7 +434,7 @@ namespace BlackCore
|
||||
const QFileInfo fi(fileName);
|
||||
if (!fi.exists())
|
||||
{
|
||||
msgs.push_back(CStatusMessage(this).warning("File '%1' does not exist") << fileName);
|
||||
msgs.push_back(CStatusMessage(this).warning(u"File '%1' does not exist") << fileName);
|
||||
}
|
||||
else if (!this->overrideCacheFromFile(overrideNewerOnly, fi, CEntityFlags::LiveryEntity, msgs))
|
||||
{
|
||||
@@ -445,7 +445,7 @@ namespace BlackCore
|
||||
const QJsonObject liveriesJson(CDatabaseUtils::readQJsonObjectFromDatabaseFile(fileName));
|
||||
if (liveriesJson.isEmpty())
|
||||
{
|
||||
msgs.push_back(CStatusMessage(this).error("Failed to read from file/empty file '%1'") << fileName);
|
||||
msgs.push_back(CStatusMessage(this).error(u"Failed to read from file/empty file '%1'") << fileName);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -472,7 +472,7 @@ namespace BlackCore
|
||||
const QFileInfo fi(fileName);
|
||||
if (!fi.exists())
|
||||
{
|
||||
msgs.push_back(CStatusMessage(this).warning("File '%1' does not exist") << fileName);
|
||||
msgs.push_back(CStatusMessage(this).warning(u"File '%1' does not exist") << fileName);
|
||||
}
|
||||
else if (!this->overrideCacheFromFile(overrideNewerOnly, fi, CEntityFlags::ModelEntity, msgs))
|
||||
{
|
||||
@@ -483,7 +483,7 @@ namespace BlackCore
|
||||
const QJsonObject modelsJson(CDatabaseUtils::readQJsonObjectFromDatabaseFile(fileName));
|
||||
if (modelsJson.isEmpty())
|
||||
{
|
||||
msgs.push_back(CStatusMessage(this).error("Failed to read from file/empty file '%1'") << fileName);
|
||||
msgs.push_back(CStatusMessage(this).error(u"Failed to read from file/empty file '%1'") << fileName);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -510,7 +510,7 @@ namespace BlackCore
|
||||
const QFileInfo fi(fileName);
|
||||
if (!fi.exists())
|
||||
{
|
||||
msgs.push_back(CStatusMessage(this).warning("File '%1' does not exist") << fileName);
|
||||
msgs.push_back(CStatusMessage(this).warning(u"File '%1' does not exist") << fileName);
|
||||
}
|
||||
else if (!this->overrideCacheFromFile(overrideNewerOnly, fi, CEntityFlags::DistributorEntity, msgs))
|
||||
{
|
||||
@@ -521,7 +521,7 @@ namespace BlackCore
|
||||
const QJsonObject distributorsJson(CDatabaseUtils::readQJsonObjectFromDatabaseFile(fileName));
|
||||
if (distributorsJson.isEmpty())
|
||||
{
|
||||
msgs.push_back(CStatusMessage(this).error("Failed to read from file/empty file '%1'") << fileName);
|
||||
msgs.push_back(CStatusMessage(this).error(u"Failed to read from file/empty file '%1'") << fileName);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -329,7 +329,7 @@ namespace BlackCore
|
||||
// be a little less verbose
|
||||
if ((m_totalGoodCountDb % 5 == 0) || m_consecutivePingBadCount > 0)
|
||||
{
|
||||
CLogMessage(this).info("Watchdog pinged '%1'") << url;
|
||||
CLogMessage(this).info(u"Watchdog pinged '%1'") << url;
|
||||
}
|
||||
m_totalGoodCountDb++;
|
||||
m_consecutivePingBadCount = 0;
|
||||
@@ -340,7 +340,7 @@ namespace BlackCore
|
||||
m_consecutivePingBadCount++;
|
||||
if (m_logOwnMessages)
|
||||
{
|
||||
CStatusMessage(this).warning("Watchdog ping failed, error: '%1', total good/bad DB counts: %2/%3") << errorString << m_totalGoodCountDb << m_totalBadCountDb;
|
||||
CStatusMessage(this).warning(u"Watchdog ping failed, error: '%1', total good/bad DB counts: %2/%3") << errorString << m_totalGoodCountDb << m_totalBadCountDb;
|
||||
}
|
||||
}
|
||||
this->setDbAccessibility(ok);
|
||||
|
||||
Reference in New Issue
Block a user