mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-30 20:15:35 +08:00
refs #501, compareByPropertyIndex (performance for sort)
This commit is contained in:
committed by
Mathew Sutcliffe
parent
1e57ce7ecb
commit
0c94922bd6
@@ -168,6 +168,25 @@ namespace BlackMisc
|
||||
}
|
||||
}
|
||||
|
||||
int CCallsign::comparePropertyByIndex(const CCallsign &compareValue, const CPropertyIndex &index) const
|
||||
{
|
||||
if (index.isMyself()) { return this->m_callsign.compare(compareValue.m_callsign, Qt::CaseInsensitive); }
|
||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
switch (i)
|
||||
{
|
||||
case IndexCallsignString:
|
||||
return this->m_callsign.compare(compareValue.m_callsign, Qt::CaseInsensitive);
|
||||
case IndexCallsignStringAsSet:
|
||||
return this->m_callsignAsSet.compare(compareValue.m_callsignAsSet, Qt::CaseInsensitive);
|
||||
case IndexTelephonyDesignator:
|
||||
return this->m_telephonyDesignator.compare(compareValue.m_telephonyDesignator, Qt::CaseInsensitive);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
Q_ASSERT_X(false, Q_FUNC_INFO, "Compare failed");
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool CCallsign::isValidCallsign(const QString &callsign)
|
||||
{
|
||||
// We allow all number callsigns
|
||||
|
||||
Reference in New Issue
Block a user