mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-03 07:35:48 +08:00
refs #140, changed CValueObject classes to tupel concept
Remarks: Changes looking like an added file result from the shift of namespace voice -> audio
This commit is contained in:
@@ -12,25 +12,6 @@ namespace BlackMisc
|
||||
return this->m_callsign;
|
||||
}
|
||||
|
||||
/*
|
||||
* Marshall to DBus
|
||||
*/
|
||||
void CCallsign::marshallToDbus(QDBusArgument &argument) const
|
||||
{
|
||||
argument << this->m_callsignAsSet;
|
||||
argument << this->m_telephonyDesignator;
|
||||
}
|
||||
|
||||
/*
|
||||
* Unmarshall from DBus
|
||||
*/
|
||||
void CCallsign::unmarshallFromDbus(const QDBusArgument &argument)
|
||||
{
|
||||
argument >> this->m_callsignAsSet;
|
||||
argument >> this->m_telephonyDesignator;
|
||||
this->m_callsign = CCallsign::unifyCallsign(this->m_callsignAsSet);
|
||||
}
|
||||
|
||||
/*
|
||||
* Unify the callsign
|
||||
*/
|
||||
@@ -96,13 +77,40 @@ namespace BlackMisc
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
* Compare
|
||||
*/
|
||||
int CCallsign::compareImpl(const CValueObject &otherBase) const
|
||||
{
|
||||
const auto &other = static_cast<const CCallsign &>(otherBase);
|
||||
|
||||
return compare(TupleConverter<CCallsign>::toTuple(*this), TupleConverter<CCallsign>::toTuple(other));
|
||||
}
|
||||
|
||||
/*
|
||||
* Marshall to DBus
|
||||
*/
|
||||
void CCallsign::marshallToDbus(QDBusArgument &argument) const
|
||||
{
|
||||
argument << TupleConverter<CCallsign>::toTuple(*this);
|
||||
}
|
||||
|
||||
/*
|
||||
* Unmarshall from DBus
|
||||
*/
|
||||
void CCallsign::unmarshallFromDbus(const QDBusArgument &argument)
|
||||
{
|
||||
argument >> TupleConverter<CCallsign>::toTuple(*this);
|
||||
}
|
||||
|
||||
/*
|
||||
* Equal?
|
||||
*/
|
||||
bool CCallsign::operator ==(const CCallsign &other) const
|
||||
{
|
||||
if (this == &other) return true;
|
||||
return other.asString() == this->asString();
|
||||
// intentionally not via Tupel converter, compare on string only
|
||||
return this->asString().compare(other.asString(), Qt::CaseInsensitive) == 0;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -113,6 +121,14 @@ namespace BlackMisc
|
||||
return !((*this) == other);
|
||||
}
|
||||
|
||||
/*
|
||||
* Hash
|
||||
*/
|
||||
uint CCallsign::getValueHash() const
|
||||
{
|
||||
return qHash(TupleConverter<CCallsign>::toTuple(*this));
|
||||
}
|
||||
|
||||
/*
|
||||
* Less than?
|
||||
*/
|
||||
@@ -121,14 +137,6 @@ namespace BlackMisc
|
||||
return this->m_callsign < other.m_callsign;
|
||||
}
|
||||
|
||||
/*
|
||||
* Hash
|
||||
*/
|
||||
uint CCallsign::getValueHash() const
|
||||
{
|
||||
return qHash(this->m_callsign);
|
||||
}
|
||||
|
||||
/*
|
||||
* metaTypeId
|
||||
*/
|
||||
@@ -147,16 +155,6 @@ namespace BlackMisc
|
||||
return this->CValueObject::isA(metaTypeId);
|
||||
}
|
||||
|
||||
/*
|
||||
* Compare
|
||||
*/
|
||||
int CCallsign::compareImpl(const CValueObject &otherBase) const
|
||||
{
|
||||
const auto &other = static_cast<const CCallsign &>(otherBase);
|
||||
|
||||
return this->m_callsign.compare(other.asString(), Qt::CaseInsensitive);
|
||||
}
|
||||
|
||||
/*
|
||||
* Register metadata
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user