mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-14 08:45:36 +08:00
Ref T28, removed areModelFilesUpdated and info if loading was from cache
* removed CacheUntilNewer * did not really work and had some problems * cache timestamp not really a good value to compare with * too slow with remote file
This commit is contained in:
committed by
Mathew Sutcliffe
parent
6fc48ab160
commit
c3ed0bc394
@@ -105,13 +105,13 @@ namespace BlackMisc
|
||||
this->setCachedModels(models, simulator); // not thread safe
|
||||
}
|
||||
// currently I treat no data as error
|
||||
emit this->loadingFinished(hasData ? statusLoadingOk : statusLoadingError, simulator);
|
||||
emit this->loadingFinished(hasData ? statusLoadingOk : statusLoadingError, simulator, ParsedData);
|
||||
}
|
||||
else
|
||||
{
|
||||
CStatusMessage status = this->m_loadingMessages.toSingleMessage();
|
||||
status.setSeverity(CStatusMessage::SeverityError);
|
||||
emit this->loadingFinished(status, simulator);
|
||||
emit this->loadingFinished(status, simulator, ParsedData);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -128,7 +128,7 @@ namespace BlackMisc
|
||||
this->setCachedModels(models); // not thread safe
|
||||
}
|
||||
// currently I treat no data as error
|
||||
emit this->loadingFinished(hasData ? statusLoadingOk : statusLoadingError, simulator);
|
||||
emit this->loadingFinished(hasData ? statusLoadingOk : statusLoadingError, simulator, ParsedData);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -137,16 +137,6 @@ namespace BlackMisc
|
||||
return !m_parserWorker || m_parserWorker->isFinished();
|
||||
}
|
||||
|
||||
bool CAircraftCfgParser::areModelFilesUpdated() const
|
||||
{
|
||||
const QDateTime cacheTs(getCacheTimestamp());
|
||||
if (!cacheTs.isValid()) { return true; }
|
||||
return CFileUtils::containsFileNewerThan(
|
||||
cacheTs,
|
||||
this->m_settings.getFirstModelDirectoryOrDefault(this->getSimulator()),
|
||||
true, { fileFilter() }, this->getModelExcludeDirectoryPatterns());
|
||||
}
|
||||
|
||||
CAircraftCfgEntriesList CAircraftCfgParser::performParsing(const QString &directory, const QStringList &excludeDirectories, CStatusMessageList &messages, bool *ok)
|
||||
{
|
||||
//
|
||||
|
||||
@@ -52,7 +52,6 @@ namespace BlackMisc
|
||||
//! \name Interface functions
|
||||
//! @{
|
||||
virtual bool isLoadingFinished() const override;
|
||||
virtual bool areModelFilesUpdated() const override;
|
||||
//! @}
|
||||
|
||||
//! Create an parser object for given simulator
|
||||
|
||||
Reference in New Issue
Block a user