fixed callsign and two models

This commit is contained in:
Klaus Basan
2014-04-26 15:55:16 +02:00
parent 9ccf005451
commit 172ea1d98e
3 changed files with 12 additions and 4 deletions

View File

@@ -35,6 +35,7 @@ namespace BlackGui
this->m_columns.clear(); this->m_columns.clear();
switch (stationMode) switch (stationMode)
{ {
case NotSet:
case StationsOnline: case StationsOnline:
this->m_columns.addColumn(CColumn("callsign", CAtcStation::IndexCallsignAsStringAsSet)); this->m_columns.addColumn(CColumn("callsign", CAtcStation::IndexCallsignAsStringAsSet));
this->m_columns.addColumn(CColumn("distance", CAtcStation::IndexDistance, Qt::AlignRight | Qt::AlignVCenter)); this->m_columns.addColumn(CColumn("distance", CAtcStation::IndexDistance, Qt::AlignRight | Qt::AlignVCenter));
@@ -61,6 +62,10 @@ namespace BlackGui
this->setSortColumnByPropertyIndex(CAtcStation::IndexBookedFrom); this->setSortColumnByPropertyIndex(CAtcStation::IndexBookedFrom);
this->m_sortOrder = Qt::AscendingOrder; this->m_sortOrder = Qt::AscendingOrder;
break; break;
default:
qFatal("Wrong mode");
break;
} }
} }
} }

View File

@@ -31,6 +31,7 @@ namespace BlackGui
this->m_columns.clear(); this->m_columns.clear();
switch (userMode) switch (userMode)
{ {
case NotSet:
case UserDetailed: case UserDetailed:
this->m_columns.addColumn(CColumn("", CUser::IndexCallsignIcon)); this->m_columns.addColumn(CColumn("", CUser::IndexCallsignIcon));
this->m_columns.addColumn(CColumn("realname", CUser::IndexRealName)); this->m_columns.addColumn(CColumn("realname", CUser::IndexRealName));
@@ -44,6 +45,10 @@ namespace BlackGui
this->m_columns.addColumn(CColumn("realname", CUser::IndexRealName)); this->m_columns.addColumn(CColumn("realname", CUser::IndexRealName));
this->m_columns.addColumn(CColumn("callsign", CUser::IndexCallsign)); this->m_columns.addColumn(CColumn("callsign", CUser::IndexCallsign));
break; break;
default:
qFatal("Wrong mode");
break;
} }
} }

View File

@@ -71,10 +71,8 @@ namespace BlackMisc
*/ */
bool CCallsign::equalsString(const QString &callsignString) const bool CCallsign::equalsString(const QString &callsignString) const
{ {
if (callsignString.isEmpty()) return false; CCallsign other(callsignString);
if (this->isEmpty()) return false; return other == (*this);
if (callsignString == this->m_callsign || callsignString == this->m_callsignAsSet) return true;
return false;
} }
/* /*