mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-06 10:15:38 +08:00
Minor tweaks:
* Altitude formatter for GUI * borders for CDockWidget * homebase for ATC
This commit is contained in:
committed by
Mathew Sutcliffe
parent
3c15f2ad89
commit
6570a0c966
@@ -25,12 +25,14 @@ namespace BlackMisc
|
||||
CUser::CUser(const QString &id, const QString &realname, const CCallsign &callsign)
|
||||
: m_id(id.trimmed()), m_realname(realname), m_callsign(callsign)
|
||||
{
|
||||
this->setRealName(realname); // extracts homebase
|
||||
this->deriveHomeBaseFromCallsign();
|
||||
this->setRealName(realname); // extracts homebase if this is included in real name
|
||||
}
|
||||
|
||||
CUser::CUser(const QString &id, const QString &realname, const QString &email, const QString &password, const CCallsign &callsign)
|
||||
: m_id(id.trimmed()), m_realname(realname), m_email(email), m_password(password), m_callsign(callsign)
|
||||
{
|
||||
this->deriveHomeBaseFromCallsign();
|
||||
this->setRealName(realname); // extracts homebase
|
||||
}
|
||||
|
||||
@@ -50,9 +52,20 @@ namespace BlackMisc
|
||||
return s;
|
||||
}
|
||||
|
||||
void CUser::deriveHomeBaseFromCallsign()
|
||||
{
|
||||
if (this->m_callsign.isEmpty()) { return; }
|
||||
if (this->m_homebase.isEmpty())
|
||||
{
|
||||
if (this->m_callsign.isAtcCallsign())
|
||||
{
|
||||
this->m_homebase = this->m_callsign.getIcaoCode();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CUser::setRealName(const QString &realname)
|
||||
{
|
||||
|
||||
QString rn(realname.trimmed().simplified());
|
||||
if (rn.isEmpty())
|
||||
{
|
||||
|
||||
@@ -142,6 +142,9 @@ namespace BlackMisc
|
||||
private:
|
||||
BLACK_ENABLE_TUPLE_CONVERSION(CUser)
|
||||
|
||||
//! derive homebase from callsign
|
||||
void deriveHomeBaseFromCallsign();
|
||||
|
||||
QString m_id;
|
||||
QString m_realname;
|
||||
QString m_email;
|
||||
|
||||
Reference in New Issue
Block a user