Ref T348, remove by model string

This commit is contained in:
Klaus Basan
2018-09-20 00:42:04 +02:00
parent e4d992bfe4
commit 136370fc63
2 changed files with 11 additions and 0 deletions

View File

@@ -506,8 +506,15 @@ namespace BlackMisc
return d;
}
int CAircraftModelList::removeModelWithString(const QString &modelString, Qt::CaseSensitivity sensitivity)
{
if (modelString.isEmpty()) { return 0; }
return this->removeIf([&](const CAircraftModel & model) { return model.matchesModelString(modelString, sensitivity); });
}
int CAircraftModelList::removeModelsWithString(const QStringList &modelStrings, Qt::CaseSensitivity sensitivity)
{
if (modelStrings.isEmpty()) { return 0; }
const int cs = this->size();
(*this) = (this->findByNotInModelStrings(modelStrings, sensitivity));
const int d = cs - this->size();