mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-05-04 08:55:43 +08:00
Ref T348, remove by model string
This commit is contained in:
@@ -506,8 +506,15 @@ namespace BlackMisc
|
|||||||
return d;
|
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)
|
int CAircraftModelList::removeModelsWithString(const QStringList &modelStrings, Qt::CaseSensitivity sensitivity)
|
||||||
{
|
{
|
||||||
|
if (modelStrings.isEmpty()) { return 0; }
|
||||||
const int cs = this->size();
|
const int cs = this->size();
|
||||||
(*this) = (this->findByNotInModelStrings(modelStrings, sensitivity));
|
(*this) = (this->findByNotInModelStrings(modelStrings, sensitivity));
|
||||||
const int d = cs - this->size();
|
const int d = cs - this->size();
|
||||||
|
|||||||
@@ -227,6 +227,10 @@ namespace BlackMisc
|
|||||||
//! \return number of elements removed
|
//! \return number of elements removed
|
||||||
int keepModelsWithString(const QStringList &modelStrings, Qt::CaseSensitivity sensitivity);
|
int keepModelsWithString(const QStringList &modelStrings, Qt::CaseSensitivity sensitivity);
|
||||||
|
|
||||||
|
//! Remove those models with given model strings
|
||||||
|
//! \return number of elements removed
|
||||||
|
int removeModelWithString(const QString &modelString, Qt::CaseSensitivity sensitivity);
|
||||||
|
|
||||||
//! Remove those models with given model strings
|
//! Remove those models with given model strings
|
||||||
//! \return number of elements removed
|
//! \return number of elements removed
|
||||||
int removeModelsWithString(const QStringList &modelStrings, Qt::CaseSensitivity sensitivity);
|
int removeModelsWithString(const QStringList &modelStrings, Qt::CaseSensitivity sensitivity);
|
||||||
|
|||||||
Reference in New Issue
Block a user