mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-01 05:26:45 +08:00
Ref T148, database reader extensions
* allow to set severity of failed reading * get entities with cached data * removed needsSharedInfoFileLoaded in CDatabaseReaderConfig
This commit is contained in:
committed by
Mathew Sutcliffe
parent
c0a6574c80
commit
a2e888546e
@@ -107,9 +107,8 @@ namespace BlackCore
|
||||
if (changedUrl)
|
||||
{
|
||||
CLogMessage(this).info("Data location for '%1' changed ('%2'->'%3'), will override cache for reading '%4'")
|
||||
<< currentEntityName
|
||||
<< oldUrlInfo.toQString() << newUrlInfo.toQString()
|
||||
<< rmDbOrSharedFlagString;
|
||||
<< currentEntityName << oldUrlInfo.toQString()
|
||||
<< newUrlInfo.toQString() << rmDbOrSharedFlagString;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -483,6 +482,12 @@ namespace BlackCore
|
||||
CLogMessage(this).info("Read %1 entities of '%2' from '%3' (%4)") << number << CEntityFlags::flagToString(entity) << res.getUrlString() << res.getLoadTimeString();
|
||||
}
|
||||
|
||||
void CDatabaseReader::logNoWorkingUrl(CEntityFlags::Entity entity)
|
||||
{
|
||||
const CStatusMessage msg = CStatusMessage(this, m_severityNoWorkingUrl, "No working URL for '%1'") << CEntityFlags::flagToString(entity);
|
||||
CLogMessage::preformatted(msg);
|
||||
}
|
||||
|
||||
CUrl CDatabaseReader::getBaseUrl(CDbFlags::DataRetrievalModeFlag mode) const
|
||||
{
|
||||
Q_ASSERT_X(sApp, Q_FUNC_INFO, "Missing app object, URLs cannot be obtained");
|
||||
@@ -562,6 +567,13 @@ namespace BlackCore
|
||||
return static_cast<int>(maskBySupportedEntities(entities)) > 0;
|
||||
}
|
||||
|
||||
bool CDatabaseReader::hasCacheTimestampNewerThan(CEntityFlags::Entity entity, const QDateTime &threshold) const
|
||||
{
|
||||
const QDateTime ts = this->getCacheTimestamp(entity);
|
||||
if (!ts.isValid()) return false;
|
||||
return ts > threshold;
|
||||
}
|
||||
|
||||
const QString &CDatabaseReader::getStatusMessage() const
|
||||
{
|
||||
return this->m_statusMessage;
|
||||
|
||||
Reference in New Issue
Block a user