Ref T525 Avoid directly calling getLogCategories.

This commit is contained in:
Mat Sutcliffe
2019-01-29 16:07:35 +00:00
parent a627752d44
commit 077fd8c35a
9 changed files with 15 additions and 15 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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())));
}

View File

@@ -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);

View File

@@ -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);
}