refs #780, fixes login/flightplan preset

* empty airline is valid
* sync with flightplan (new signal to indicate changed login values)
* better preset of own model
This commit is contained in:
Klaus Basan
2016-10-21 15:38:25 +02:00
parent 492649c061
commit cdea8cff95
12 changed files with 127 additions and 25 deletions

View File

@@ -103,7 +103,7 @@ namespace BlackMisc
int pos = match.capturedStart(0);
QString icao = match.captured(0).trimmed().right(4);
rn = rn.left(pos).trimmed();
this->setHomebase(CAirportIcaoCode(icao));
this->setHomeBase(CAirportIcaoCode(icao));
}
}
@@ -130,7 +130,7 @@ namespace BlackMisc
if (!this->hasValidCallsign()) { this->setCallsign(otherUser.getCallsign()); }
}
void CUser::syncronizeData(CUser &otherUser)
void CUser::synchronizeData(CUser &otherUser)
{
if (this == &otherUser) { return; }
this->updateMissingParts(otherUser);
@@ -239,7 +239,7 @@ namespace BlackMisc
case IndexRealName:
return this->m_realname.compare(compareValue.getRealName(), Qt::CaseInsensitive);
case IndexHomebase:
return this->m_homebase.comparePropertyByIndex(index.copyFrontRemoved(), compareValue.getHomebase());
return this->m_homebase.comparePropertyByIndex(index.copyFrontRemoved(), compareValue.getHomeBase());
case IndexCallsign:
return this->m_callsign.comparePropertyByIndex(index.copyFrontRemoved(), compareValue.getCallsign());
default:

View File

@@ -109,10 +109,13 @@ namespace BlackMisc
void setId(const QString &id) { m_id = id.trimmed(); }
//! Homebase
const BlackMisc::Aviation::CAirportIcaoCode &getHomebase() const { return this->m_homebase; }
const BlackMisc::Aviation::CAirportIcaoCode &getHomeBase() const { return this->m_homebase; }
//! Set homebase
void setHomebase(const BlackMisc::Aviation::CAirportIcaoCode &homebase) { this->m_homebase = homebase; }
void setHomeBase(const BlackMisc::Aviation::CAirportIcaoCode &homebase) { this->m_homebase = homebase; }
//! Has home base?
bool hasHomeBase() const { return !this->m_homebase.isEmpty(); }
//! Get associated callsign.
const BlackMisc::Aviation::CCallsign &getCallsign() const { return m_callsign; }
@@ -133,7 +136,7 @@ namespace BlackMisc
int comparePropertyByIndex(const CPropertyIndex &index, const CUser &compareValue) const;
//! This and another user exchange missing data, This user has priority and overrides first.
void syncronizeData(CUser &otherUser);
void synchronizeData(CUser &otherUser);
//! Update missing parts in this object
void updateMissingParts(const CUser &otherUser);