mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 23:05:36 +08:00
Ref T525 Avoid directly calling getLogCategories.
This commit is contained in:
@@ -1038,7 +1038,7 @@ namespace BlackCore
|
||||
const CStatusMessage m = this->supportsContexts() ?
|
||||
this->getIContextApplication()->saveSettings() :
|
||||
CSettingsCache::instance()->saveToStore();
|
||||
CLogMessage(getLogCategories()).preformatted(m);
|
||||
CLogMessage(this).preformatted(m);
|
||||
}
|
||||
|
||||
// from here on we really rip apart the application object
|
||||
|
||||
@@ -92,7 +92,7 @@ namespace BlackCore
|
||||
|
||||
const CStatusMessage &CContext::statusMessageEmptyContext()
|
||||
{
|
||||
static const CStatusMessage m(getLogCategories(), CStatusMessage::SeverityWarning, u"empty context");
|
||||
static const CStatusMessage m(static_cast<CContext *>(nullptr), CStatusMessage::SeverityWarning, u"empty context");
|
||||
return m;
|
||||
}
|
||||
} // ns
|
||||
|
||||
@@ -757,7 +757,7 @@ namespace BlackCore
|
||||
if (jsonContent.isEmpty())
|
||||
{
|
||||
static const QString errorMsg = "Empty JSON string, status: %1, URL: '%2', load time: %3";
|
||||
datastoreResponse.setMessage(CStatusMessage(getLogCategories(),
|
||||
datastoreResponse.setMessage(CStatusMessage(static_cast<CDatabaseReader *>(nullptr),
|
||||
CStatusMessage::SeverityError,
|
||||
errorMsg.arg(status).arg(datastoreResponse.getUrlString(), datastoreResponse.getLoadTimeStringWithStartedHint())));
|
||||
return;
|
||||
@@ -770,14 +770,14 @@ namespace BlackCore
|
||||
{
|
||||
static const QString errorMsg = "Looks like PHP errror, status %1, URL: '%2', msg: %3";
|
||||
const QString phpErrorMessage = CNetworkUtils::removeHtmlPartsFromPhpErrorMessage(jsonContent);
|
||||
datastoreResponse.setMessage(CStatusMessage(getLogCategories(),
|
||||
datastoreResponse.setMessage(CStatusMessage(static_cast<CDatabaseReader *>(nullptr),
|
||||
CStatusMessage::SeverityError,
|
||||
errorMsg.arg(status).arg(datastoreResponse.getUrlString(), phpErrorMessage)));
|
||||
}
|
||||
else
|
||||
{
|
||||
static const QString errorMsg = "Empty JSON document, URL: '%1', load time: %2";
|
||||
datastoreResponse.setMessage(CStatusMessage(getLogCategories(),
|
||||
datastoreResponse.setMessage(CStatusMessage(static_cast<CDatabaseReader *>(nullptr),
|
||||
CStatusMessage::SeverityError,
|
||||
errorMsg.arg(datastoreResponse.getUrlString(), datastoreResponse.getLoadTimeStringWithStartedHint())));
|
||||
}
|
||||
|
||||
@@ -340,7 +340,7 @@ namespace BlackCore
|
||||
stashModels.push_back(dbModel); // changed DB model
|
||||
if (updateInfo)
|
||||
{
|
||||
const CStatusMessage m = CStatusMessage(getLogCategories()).info(u"%1 -> %2 (%3) for '%4'")
|
||||
const CStatusMessage m = CStatusMessage(static_cast<CDatabaseUtils *>(nullptr)).info(u"%1 -> %2 (%3) for '%4'")
|
||||
<< dbModelSimulator.toQString(true) << simulator.toQString(true)
|
||||
<< delta.toQString(true) << dbModel.getModelStringAndDbKey();
|
||||
updateInfo->push_back(m);
|
||||
|
||||
@@ -493,7 +493,7 @@ namespace BlackCore
|
||||
CStatusMessage m = m_updateInfo.set(updateInfo, lastModified);
|
||||
if (m.isFailure())
|
||||
{
|
||||
m.addCategories(getLogCategories());
|
||||
m.addCategories(this);
|
||||
CLogMessage::preformatted(m);
|
||||
this->manageUpdateInfoAvailability(false);
|
||||
}
|
||||
|
||||
@@ -416,7 +416,7 @@ namespace BlackMisc
|
||||
}
|
||||
catch (const CJsonException &ex)
|
||||
{
|
||||
const CStatusMessage m = ex.toStatusMessage(getLogCategories(), QString("Parsing flight plan from failed."));
|
||||
const CStatusMessage m = ex.toStatusMessage(&fp, QString("Parsing flight plan from failed."));
|
||||
Q_UNUSED(m);
|
||||
}
|
||||
return fp;
|
||||
@@ -457,7 +457,7 @@ namespace BlackMisc
|
||||
CStatusMessage m;
|
||||
if (!Json::looksLikeSwiftJson(data))
|
||||
{
|
||||
m = CStatusMessage(CFlightPlan::getLogCategories(), CStatusMessage::SeverityWarning, u"Reading '%1' yields no data", true) << fileName;
|
||||
m = CStatusMessage(getLogCategories(), CStatusMessage::SeverityWarning, u"Reading '%1' yields no data", true) << fileName;
|
||||
if (msgs) { msgs->push_back(m); }
|
||||
break;
|
||||
}
|
||||
@@ -477,7 +477,7 @@ namespace BlackMisc
|
||||
}
|
||||
else
|
||||
{
|
||||
m = CStatusMessage(CFlightPlan::getLogCategories(), CStatusMessage::SeverityWarning, u"Wrong format for flight plan in '%1'") << fileName;
|
||||
m = CStatusMessage(getLogCategories(), CStatusMessage::SeverityWarning, u"Wrong format for flight plan in '%1'") << fileName;
|
||||
if (msgs) { msgs->push_back(m); }
|
||||
}
|
||||
}
|
||||
@@ -489,7 +489,7 @@ namespace BlackMisc
|
||||
}
|
||||
catch (const CJsonException &ex)
|
||||
{
|
||||
m = ex.toStatusMessage(CFlightPlan::getLogCategories(), "Parse error in " + fileName);
|
||||
m = ex.toStatusMessage(getLogCategories(), "Parse error in " + fileName);
|
||||
if (msgs) { msgs->push_back(m); }
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -231,7 +231,7 @@ namespace BlackMisc
|
||||
QFile file(fnFixed); // includes path
|
||||
if (!file.open(QFile::ReadOnly | QFile::Text))
|
||||
{
|
||||
const CStatusMessage m = CStatusMessage(getLogCategories()).warning(u"Unable to read file '%1'") << fnFixed;
|
||||
const CStatusMessage m = CStatusMessage(static_cast<CAircraftCfgParser *>(nullptr)).warning(u"Unable to read file '%1'") << fnFixed;
|
||||
msgs.push_back(m);
|
||||
return CAircraftCfgEntriesList();
|
||||
}
|
||||
@@ -371,7 +371,7 @@ namespace BlackMisc
|
||||
{
|
||||
if (e.getTitle().isEmpty())
|
||||
{
|
||||
const CStatusMessage m = CStatusMessage(getLogCategories()).info(u"FS model in %1, index %2 has no title") << fileName << e.getIndex();
|
||||
const CStatusMessage m = CStatusMessage(static_cast<CAircraftCfgParser *>(nullptr)).info(u"FS model in %1, index %2 has no title") << fileName << e.getIndex();
|
||||
msgs.push_back(m);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -443,7 +443,7 @@ namespace BlackMisc
|
||||
{
|
||||
const QJsonDocument doc(jsonObject);
|
||||
const QString partsAsString = doc.toJson(QJsonDocument::Compact);
|
||||
const CStatusMessage message(getLogCategories(), CStatusMessage::SeverityInfo, callsign.isEmpty() ? callsign.toQString() + ": " + partsAsString.trimmed() : partsAsString.trimmed());
|
||||
const CStatusMessage message(this, CStatusMessage::SeverityInfo, callsign.isEmpty() ? callsign.toQString() + ": " + partsAsString.trimmed() : partsAsString.trimmed());
|
||||
|
||||
QReadLocker l(&m_lockPartsHistory);
|
||||
if (m_aircraftPartsMessages.contains(callsign))
|
||||
|
||||
@@ -2088,7 +2088,7 @@ namespace BlackSimPlugin
|
||||
if (position.Airspeed < 2)
|
||||
{
|
||||
position.OnGround = 1U;
|
||||
if (details) { *details = CStatusMessage(getLogCategories()).warning(u"Force GND flag for underflow protection"); }
|
||||
if (details) { *details = CStatusMessage(static_cast<CSimulatorFsxCommon *>(nullptr)).warning(u"Force GND flag for underflow protection"); }
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user