mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-02 15:15:50 +08:00
Ref T509, utility function
This commit is contained in:
committed by
Mat Sutcliffe
parent
66c2059538
commit
c67ca53aa1
@@ -388,6 +388,24 @@ namespace BlackMisc
|
||||
return modelStrings;
|
||||
}
|
||||
|
||||
QMap<CDistributor, int> CAircraftModelList::countPerDistributor() const
|
||||
{
|
||||
QMap<CDistributor, int> distributors;
|
||||
for (const CAircraftModel &model : *this)
|
||||
{
|
||||
if (!model.hasDistributor()) { continue; }
|
||||
if (distributors.contains(model.getDistributor()))
|
||||
{
|
||||
distributors[model.getDistributor()]++;
|
||||
}
|
||||
else
|
||||
{
|
||||
distributors[model.getDistributor()] = 1;
|
||||
}
|
||||
}
|
||||
return distributors;
|
||||
}
|
||||
|
||||
QString CAircraftModelList::findModelIconPathByModelString(const QString &modelString) const
|
||||
{
|
||||
if (modelString.isEmpty()) { return {}; }
|
||||
|
||||
Reference in New Issue
Block a user