Ref T451, added disable functionality in matcher

This commit is contained in:
Klaus Basan
2018-12-24 07:02:32 +01:00
committed by Mat Sutcliffe
parent b648960b59
commit 7f9182a1c4
2 changed files with 35 additions and 7 deletions

View File

@@ -753,6 +753,26 @@ namespace BlackCore
return models.size();
}
void CAircraftMatcher::disableModelsForMatching(const CAircraftModelList &removedModels, bool incremental)
{
if (incremental)
{
m_modelSet.removeModelsWithString(removedModels, Qt::CaseInsensitive);
m_disabledModels.push_back(removedModels);
}
else
{
this->restoreDisabledModels();
m_disabledModels = removedModels;
m_modelSet.removeModelsWithString(removedModels, Qt::CaseInsensitive);
}
}
void CAircraftMatcher::restoreDisabledModels()
{
m_modelSet.replaceOrAddModelsWithString(m_disabledModels, Qt::CaseInsensitive);
}
void CAircraftMatcher::setDefaultModel(const CAircraftModel &defaultModel)
{
m_defaultModel = defaultModel;