mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-02 23:25:53 +08:00
refs #755, restore distributor order when consolidating with DB data
(formerly order was overridden)
This commit is contained in:
committed by
Roland Winklmeier
parent
1e8090d366
commit
cbc095d230
@@ -327,7 +327,15 @@ namespace BlackMisc
|
||||
this->getLivery().isMilitary();
|
||||
}
|
||||
|
||||
bool CAircraftModel::updateDistributorOrder(const CDistributorList &distributors)
|
||||
bool CAircraftModel::setDistributorOrder(int order)
|
||||
{
|
||||
if (order < 0) { return false; }
|
||||
if (!this->m_distributor.isLoadedFromDb()) { return false; }
|
||||
this->m_distributor.setOrder(order);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CAircraftModel::setDistributorOrder(const CDistributorList &distributors)
|
||||
{
|
||||
if (distributors.isEmpty()) { return false; }
|
||||
bool found = false;
|
||||
|
||||
@@ -216,8 +216,11 @@ namespace BlackMisc
|
||||
//! Set distributor
|
||||
void setDistributor(const CDistributor &distributor) { m_distributor = distributor; }
|
||||
|
||||
//! Set the distributor order
|
||||
bool setDistributorOrder(int order);
|
||||
|
||||
//! Update distributor`s order attribute
|
||||
bool updateDistributorOrder(const CDistributorList &distributors);
|
||||
bool setDistributorOrder(const CDistributorList &distributors);
|
||||
|
||||
//! Distributor
|
||||
bool hasDistributor() const;
|
||||
|
||||
@@ -498,7 +498,7 @@ namespace BlackMisc
|
||||
int found = 0;
|
||||
for (CAircraftModel &model : *this)
|
||||
{
|
||||
if (model.updateDistributorOrder(distributors)) { found ++; }
|
||||
if (model.setDistributorOrder(distributors)) { found ++; }
|
||||
}
|
||||
return found;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user