mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-14 08:45:36 +08:00
refs #571, consolidate with own models or DB models when stashed (goal: better defaults)
* improved missing parts updates * sync. with own and DB models
This commit is contained in:
@@ -225,6 +225,16 @@ namespace BlackMisc
|
||||
|
||||
void CAirlineIcaoCode::updateMissingParts(const CAirlineIcaoCode &otherIcaoCode)
|
||||
{
|
||||
if (!this->hasValidDbKey() && otherIcaoCode.hasValidDbKey())
|
||||
{
|
||||
// we have no DB data, but the other one has
|
||||
// so we change roles. We take the DB object as base, and update our parts
|
||||
CAirlineIcaoCode copy(otherIcaoCode);
|
||||
copy.updateMissingParts(*this);
|
||||
*this = copy;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!this->hasValidDesignator()) { this->setDesignator(otherIcaoCode.getDesignator()); }
|
||||
if (!this->hasValidCountry()) { this->setCountry(otherIcaoCode.getCountry()); }
|
||||
if (!this->hasName()) { this->setName(otherIcaoCode.getName()); }
|
||||
|
||||
Reference in New Issue
Block a user