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:
Klaus Basan
2017-05-04 01:46:32 +02:00
committed by Mathew Sutcliffe
parent 6fc48ab160
commit c3ed0bc394
6 changed files with 27 additions and 50 deletions

View File

@@ -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)
{
//

View File

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