refs #345 Added a metatuple flag for case insensitive comparisons, so CAirportIcao and CCallsign comparisons can use metatuples.

This commit is contained in:
Mathew Sutcliffe
2014-10-31 23:10:17 +00:00
parent 1283d50737
commit ecf8e6aafb
6 changed files with 59 additions and 22 deletions

View File

@@ -85,7 +85,7 @@ namespace BlackMisc
int CCallsign::compareImpl(const CValueObject &otherBase) const
{
const auto &other = static_cast<const CCallsign &>(otherBase);
return this->m_callsign.compare(other.m_callsign, Qt::CaseInsensitive);
return compare(TupleConverter<CCallsign>::toMetaTuple(*this), TupleConverter<CCallsign>::toMetaTuple(other));
}
/*
@@ -181,7 +181,7 @@ namespace BlackMisc
bool CCallsign::operator ==(const CCallsign &other) const
{
if (this == &other) return true;
return this->asString().compare(other.asString(), Qt::CaseInsensitive) == 0;
return TupleConverter<CCallsign>::toMetaTuple(*this) == TupleConverter<CCallsign>::toMetaTuple(other);
}
/*