mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-05 09:15:34 +08:00
refs #655, Change signature (order) of setProperty/compareProperty
This commit is contained in:
committed by
Roland Winklmeier
parent
49094115b1
commit
0f5d2a29a8
@@ -84,7 +84,6 @@ namespace BlackMisc
|
||||
this->isValidFrequency(this->getFrequencyStandby());
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -354,10 +354,10 @@ namespace BlackMisc
|
||||
}
|
||||
}
|
||||
|
||||
void CAircraftIcaoCode::setPropertyByIndex(const CVariant &variant, const BlackMisc::CPropertyIndex &index)
|
||||
void CAircraftIcaoCode::setPropertyByIndex(const CPropertyIndex &index, const CVariant &variant)
|
||||
{
|
||||
if (index.isMyself()) { (*this) = variant.to<CAircraftIcaoCode>(); return; }
|
||||
if (IDatastoreObjectWithIntegerKey::canHandleIndex(index)) { IDatastoreObjectWithIntegerKey::setPropertyByIndex(variant, index); return; }
|
||||
if (IDatastoreObjectWithIntegerKey::canHandleIndex(index)) { IDatastoreObjectWithIntegerKey::setPropertyByIndex(index, variant); return; }
|
||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
switch (i)
|
||||
{
|
||||
@@ -392,15 +392,15 @@ namespace BlackMisc
|
||||
this->m_rank = variant.toInt();
|
||||
break;
|
||||
default:
|
||||
CValueObject::setPropertyByIndex(variant, index);
|
||||
CValueObject::setPropertyByIndex(index, variant);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
int CAircraftIcaoCode::comparePropertyByIndex(const CAircraftIcaoCode &compareValue, const CPropertyIndex &index) const
|
||||
int CAircraftIcaoCode::comparePropertyByIndex(const CPropertyIndex &index, const CAircraftIcaoCode &compareValue) const
|
||||
{
|
||||
if (index.isMyself()) { return m_designator.compare(compareValue.getDesignator(), Qt::CaseInsensitive); }
|
||||
if (IDatastoreObjectWithIntegerKey::canHandleIndex(index)) { return IDatastoreObjectWithIntegerKey::comparePropertyByIndex(compareValue, index);}
|
||||
if (IDatastoreObjectWithIntegerKey::canHandleIndex(index)) { return IDatastoreObjectWithIntegerKey::comparePropertyByIndex(index, compareValue);}
|
||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
switch (i)
|
||||
{
|
||||
|
||||
@@ -223,10 +223,10 @@ namespace BlackMisc
|
||||
CVariant propertyByIndex(const BlackMisc::CPropertyIndex &index) const;
|
||||
|
||||
//! \copydoc BlackMisc::Mixin::Index::setPropertyByIndex
|
||||
void setPropertyByIndex(const CVariant &variant, const BlackMisc::CPropertyIndex &index);
|
||||
void setPropertyByIndex(const BlackMisc::CPropertyIndex &index, const CVariant &variant);
|
||||
|
||||
//! Compare for index
|
||||
int comparePropertyByIndex(const CAircraftIcaoCode &compareValue, const CPropertyIndex &index) const;
|
||||
int comparePropertyByIndex(const CPropertyIndex &index, const CAircraftIcaoCode &compareValue) const;
|
||||
|
||||
//! \copydoc BlackMisc::Mixin::String::toQString
|
||||
QString convertToQString(bool i18n = false) const;
|
||||
|
||||
@@ -74,7 +74,7 @@ namespace BlackMisc
|
||||
}
|
||||
}
|
||||
|
||||
void CAircraftLights::setPropertyByIndex(const CVariant &variant, const BlackMisc::CPropertyIndex &index)
|
||||
void CAircraftLights::setPropertyByIndex(const CPropertyIndex &index, const CVariant &variant)
|
||||
{
|
||||
if (index.isMyself()) { (*this) = variant.to<CAircraftLights>(); return; }
|
||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
@@ -99,7 +99,7 @@ namespace BlackMisc
|
||||
this->m_taxiOn = variant.toBool();
|
||||
break;
|
||||
default:
|
||||
CValueObject::setPropertyByIndex(variant, index);
|
||||
CValueObject::setPropertyByIndex(index, variant);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace BlackMisc
|
||||
CVariant propertyByIndex(const BlackMisc::CPropertyIndex &index) const;
|
||||
|
||||
//! \copydoc BlackMisc::Mixin::Index::setPropertyByIndex
|
||||
void setPropertyByIndex(const CVariant &variant, const BlackMisc::CPropertyIndex &index);
|
||||
void setPropertyByIndex(const BlackMisc::CPropertyIndex &index, const CVariant &variant);
|
||||
|
||||
//! Strobes lights on?
|
||||
bool isStrobeOn() const { return m_strobeOn; }
|
||||
|
||||
@@ -57,10 +57,10 @@ namespace BlackMisc
|
||||
}
|
||||
}
|
||||
|
||||
void CAircraftParts::setPropertyByIndex(const CVariant &variant, const BlackMisc::CPropertyIndex &index)
|
||||
void CAircraftParts::setPropertyByIndex(const CPropertyIndex &index, const CVariant &variant)
|
||||
{
|
||||
if (index.isMyself()) { (*this) = variant.to<CAircraftParts>(); return; }
|
||||
if (ITimestampBased::canHandleIndex(index)) { ITimestampBased::setPropertyByIndex(variant, index); return; }
|
||||
if (ITimestampBased::canHandleIndex(index)) { ITimestampBased::setPropertyByIndex(index, variant); return; }
|
||||
|
||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
switch (i)
|
||||
@@ -75,21 +75,21 @@ namespace BlackMisc
|
||||
this->m_gearDown = variant.toBool();
|
||||
break;
|
||||
case IndexLights:
|
||||
this->m_lights.setPropertyByIndex(variant, index.copyFrontRemoved());
|
||||
this->m_lights.setPropertyByIndex(index.copyFrontRemoved(), variant);
|
||||
break;
|
||||
case IndexSpoilersOut:
|
||||
this->m_spoilersOut = variant.toBool();
|
||||
break;
|
||||
default:
|
||||
CValueObject::setPropertyByIndex(variant, index);
|
||||
CValueObject::setPropertyByIndex(index, variant);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
int CAircraftParts::comparePropertyByIndex(const CAircraftParts &compareValue, const CPropertyIndex &index) const
|
||||
int CAircraftParts::comparePropertyByIndex(const CPropertyIndex &index, const CAircraftParts &compareValue) const
|
||||
{
|
||||
if (index.isMyself()) { return ITimestampBased::comparePropertyByIndex(compareValue, CPropertyIndex()); }
|
||||
if (ITimestampBased::canHandleIndex(index)) { return ITimestampBased::comparePropertyByIndex(compareValue, index); }
|
||||
if (index.isMyself()) { return ITimestampBased::comparePropertyByIndex(CPropertyIndex(), compareValue); }
|
||||
if (ITimestampBased::canHandleIndex(index)) { return ITimestampBased::comparePropertyByIndex(index, compareValue); }
|
||||
|
||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
switch (i)
|
||||
|
||||
@@ -54,10 +54,10 @@ namespace BlackMisc
|
||||
CVariant propertyByIndex(const BlackMisc::CPropertyIndex &index) const;
|
||||
|
||||
//! \copydoc BlackMisc::Mixin::Index::setPropertyByIndex
|
||||
void setPropertyByIndex(const CVariant &variant, const BlackMisc::CPropertyIndex &index);
|
||||
void setPropertyByIndex(const BlackMisc::CPropertyIndex &index, const CVariant &variant);
|
||||
|
||||
//! Compare for index
|
||||
int comparePropertyByIndex(const CAircraftParts &compareValue, const CPropertyIndex &index) const;
|
||||
int comparePropertyByIndex(const CPropertyIndex &index, const CAircraftParts &compareValue) const;
|
||||
|
||||
//! Get aircraft lights
|
||||
CAircraftLights getLights() const { return m_lights; }
|
||||
|
||||
@@ -78,12 +78,12 @@ namespace BlackMisc
|
||||
}
|
||||
}
|
||||
|
||||
void CAircraftSituation::setPropertyByIndex(const CVariant &variant, const BlackMisc::CPropertyIndex &index)
|
||||
void CAircraftSituation::setPropertyByIndex(const CPropertyIndex &index, const CVariant &variant)
|
||||
{
|
||||
if (index.isMyself()) { (*this) = variant.to<CAircraftSituation>(); return; }
|
||||
if (ITimestampBased::canHandleIndex(index))
|
||||
{
|
||||
ITimestampBased::setPropertyByIndex(variant, index);
|
||||
ITimestampBased::setPropertyByIndex(index, variant);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -91,25 +91,25 @@ namespace BlackMisc
|
||||
switch (i)
|
||||
{
|
||||
case IndexPosition:
|
||||
this->m_position.setPropertyByIndex(variant, index.copyFrontRemoved());
|
||||
this->m_position.setPropertyByIndex(index.copyFrontRemoved(), variant);
|
||||
break;
|
||||
case IndexAltitude:
|
||||
this->m_altitude.setPropertyByIndex(variant, index.copyFrontRemoved());
|
||||
this->m_altitude.setPropertyByIndex(index.copyFrontRemoved(), variant);
|
||||
break;
|
||||
case IndexPitch:
|
||||
this->m_pitch.setPropertyByIndex(variant, index.copyFrontRemoved());
|
||||
this->m_pitch.setPropertyByIndex(index.copyFrontRemoved(), variant);
|
||||
break;
|
||||
case IndexBank:
|
||||
this->m_bank.setPropertyByIndex(variant, index.copyFrontRemoved());
|
||||
this->m_bank.setPropertyByIndex(index.copyFrontRemoved(), variant);
|
||||
break;
|
||||
case IndexGroundspeed:
|
||||
this->m_groundSpeed.setPropertyByIndex(variant, index.copyFrontRemoved());
|
||||
this->m_groundSpeed.setPropertyByIndex(index.copyFrontRemoved(), variant);
|
||||
break;
|
||||
case IndexCallsign:
|
||||
this->m_correspondingCallsign.setPropertyByIndex(variant, index.copyFrontRemoved());
|
||||
this->m_correspondingCallsign.setPropertyByIndex(index.copyFrontRemoved(), variant);
|
||||
break;
|
||||
default:
|
||||
CValueObject::setPropertyByIndex(variant, index);
|
||||
CValueObject::setPropertyByIndex(index, variant);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ namespace BlackMisc
|
||||
CVariant propertyByIndex(const BlackMisc::CPropertyIndex &index) const;
|
||||
|
||||
//! \copydoc BlackMisc::Mixin::Index::setPropertyByIndex
|
||||
void setPropertyByIndex(const CVariant &variant, const BlackMisc::CPropertyIndex &index);
|
||||
void setPropertyByIndex(const BlackMisc::CPropertyIndex &index, const CVariant &variant);
|
||||
|
||||
//! Get position
|
||||
const BlackMisc::Geo::CCoordinateGeodetic &getPosition() const { return this->m_position; }
|
||||
|
||||
@@ -166,10 +166,10 @@ namespace BlackMisc
|
||||
}
|
||||
}
|
||||
|
||||
void CAirlineIcaoCode::setPropertyByIndex(const CVariant &variant, const BlackMisc::CPropertyIndex &index)
|
||||
void CAirlineIcaoCode::setPropertyByIndex(const CPropertyIndex &index, const CVariant &variant)
|
||||
{
|
||||
if (index.isMyself()) { (*this) = variant.to<CAirlineIcaoCode>(); return; }
|
||||
if (IDatastoreObjectWithIntegerKey::canHandleIndex(index)) { IDatastoreObjectWithIntegerKey::setPropertyByIndex(variant, index); return; }
|
||||
if (IDatastoreObjectWithIntegerKey::canHandleIndex(index)) { IDatastoreObjectWithIntegerKey::setPropertyByIndex(index, variant); return; }
|
||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
switch (i)
|
||||
{
|
||||
@@ -198,16 +198,16 @@ namespace BlackMisc
|
||||
this->setMilitary(variant.toBool());
|
||||
break;
|
||||
default:
|
||||
CValueObject::setPropertyByIndex(variant, index);
|
||||
CValueObject::setPropertyByIndex(index, variant);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
int CAirlineIcaoCode::comparePropertyByIndex(const CAirlineIcaoCode &compareValue, const CPropertyIndex &index) const
|
||||
int CAirlineIcaoCode::comparePropertyByIndex(const CPropertyIndex &index, const CAirlineIcaoCode &compareValue) const
|
||||
{
|
||||
if (index.isMyself()) { return m_designator.compare(compareValue.getDesignator(), Qt::CaseInsensitive); }
|
||||
if (IDatastoreObjectWithIntegerKey::canHandleIndex(index)) { return IDatastoreObjectWithIntegerKey::comparePropertyByIndex(compareValue, index);}
|
||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
if (IDatastoreObjectWithIntegerKey::canHandleIndex(index)) { return IDatastoreObjectWithIntegerKey::comparePropertyByIndex(index, compareValue);}
|
||||
const ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
switch (i)
|
||||
{
|
||||
case IndexAirlineDesignator:
|
||||
@@ -215,7 +215,7 @@ namespace BlackMisc
|
||||
case IndexIataCode:
|
||||
return this->m_iataCode.compare(compareValue.getIataCode());
|
||||
case IndexAirlineCountry:
|
||||
return this->m_country.comparePropertyByIndex(compareValue.getCountry(), index.copyFrontRemoved());
|
||||
return this->m_country.comparePropertyByIndex(index.copyFrontRemoved(), compareValue.getCountry());
|
||||
case IndexDesignatorNameCountry:
|
||||
return this->m_country.getName().compare(compareValue.getCountry().getName(), Qt::CaseInsensitive);
|
||||
case IndexAirlineName:
|
||||
@@ -326,6 +326,5 @@ namespace BlackMisc
|
||||
code.setKeyAndTimestampFromDatabaseJson(json, prefix);
|
||||
return code;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
@@ -159,10 +159,10 @@ namespace BlackMisc
|
||||
CVariant propertyByIndex(const BlackMisc::CPropertyIndex &index) const;
|
||||
|
||||
//! \copydoc BlackMisc::Mixin::Index::setPropertyByIndex
|
||||
void setPropertyByIndex(const CVariant &variant, const BlackMisc::CPropertyIndex &index);
|
||||
void setPropertyByIndex(const BlackMisc::CPropertyIndex &index, const CVariant &variant);
|
||||
|
||||
//! Compare for index
|
||||
int comparePropertyByIndex(const CAirlineIcaoCode &compareValue, const CPropertyIndex &index) const;
|
||||
int comparePropertyByIndex(const CPropertyIndex &index, const CAirlineIcaoCode &compareValue) const;
|
||||
|
||||
//! Validate data
|
||||
BlackMisc::CStatusMessageList validate() const;
|
||||
|
||||
@@ -72,48 +72,48 @@ namespace BlackMisc
|
||||
}
|
||||
}
|
||||
|
||||
void CAirport::setPropertyByIndex(const CVariant &variant, const BlackMisc::CPropertyIndex &index)
|
||||
void CAirport::setPropertyByIndex(const BlackMisc::CPropertyIndex &index, const CVariant &variant)
|
||||
{
|
||||
if (index.isMyself()) { (*this) = variant.to<CAirport>(); return; }
|
||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
switch (i)
|
||||
{
|
||||
case IndexIcao:
|
||||
this->m_icao.setPropertyByIndex(variant, index.copyFrontRemoved());
|
||||
this->m_icao.setPropertyByIndex(index.copyFrontRemoved(), variant);
|
||||
break;
|
||||
case IndexDescriptiveName:
|
||||
this->setDescriptiveName(variant.toQString());
|
||||
break;
|
||||
case IndexPosition:
|
||||
this->m_position.setPropertyByIndex(variant, index.copyFrontRemoved());
|
||||
this->m_position.setPropertyByIndex(index.copyFrontRemoved(), variant);
|
||||
break;
|
||||
case IndexBearing:
|
||||
this->m_bearingToOwnAircraft.setPropertyByIndex(variant, index.copyFrontRemoved());
|
||||
this->m_bearingToOwnAircraft.setPropertyByIndex(index.copyFrontRemoved(), variant);
|
||||
break;
|
||||
case IndexDistanceToOwnAircraft:
|
||||
this->m_distanceToOwnAircraft.setPropertyByIndex(variant, index.copyFrontRemoved());
|
||||
this->m_distanceToOwnAircraft.setPropertyByIndex(index.copyFrontRemoved(), variant);
|
||||
break;
|
||||
default:
|
||||
CValueObject::setPropertyByIndex(variant, index);
|
||||
CValueObject::setPropertyByIndex(index, variant);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
int CAirport::comparePropertyByIndex(const CAirport &compareValue, const CPropertyIndex &index) const
|
||||
int CAirport::comparePropertyByIndex(const CPropertyIndex &index, const CAirport &compareValue) const
|
||||
{
|
||||
if (index.isMyself()) { return this->m_icao.comparePropertyByIndex(compareValue.getIcao(), index.copyFrontRemoved()); }
|
||||
if (index.isMyself()) { return this->m_icao.comparePropertyByIndex(index.copyFrontRemoved(), compareValue.getIcao()); }
|
||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
switch (i)
|
||||
{
|
||||
case IndexIcao:
|
||||
return this->m_icao.comparePropertyByIndex(compareValue.getIcao(), index.copyFrontRemoved());
|
||||
return this->m_icao.comparePropertyByIndex(index.copyFrontRemoved(), compareValue.getIcao());
|
||||
case IndexDescriptiveName:
|
||||
return this->m_descriptiveName.compare(compareValue.getDescriptiveName(), Qt::CaseInsensitive);
|
||||
case IndexBearing:
|
||||
return this->m_bearingToOwnAircraft.comparePropertyByIndex(compareValue.getBearingToOwnAircraft(), index.copyFrontRemoved());
|
||||
return this->m_bearingToOwnAircraft.comparePropertyByIndex(index.copyFrontRemoved(), compareValue.getBearingToOwnAircraft());
|
||||
case IndexPosition:
|
||||
case IndexDistanceToOwnAircraft:
|
||||
return this->m_distanceToOwnAircraft.comparePropertyByIndex(compareValue.getDistanceToOwnAircraft(), index.copyFrontRemoved());
|
||||
return this->m_distanceToOwnAircraft.comparePropertyByIndex(index.copyFrontRemoved(), compareValue.getDistanceToOwnAircraft());
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -106,10 +106,10 @@ namespace BlackMisc
|
||||
CVariant propertyByIndex(const BlackMisc::CPropertyIndex &index) const;
|
||||
|
||||
//! \copydoc BlackMisc::Mixin::Index::setPropertyByIndex
|
||||
void setPropertyByIndex(const CVariant &variant, const BlackMisc::CPropertyIndex &index);
|
||||
void setPropertyByIndex(const BlackMisc::CPropertyIndex &index, const CVariant &variant);
|
||||
|
||||
//! Compare for index
|
||||
int comparePropertyByIndex(const CAirport &compareValue, const CPropertyIndex &index) const;
|
||||
int comparePropertyByIndex(const CPropertyIndex &index, const CAirport &compareValue) const;
|
||||
|
||||
//! \copydoc BlackMisc::Mixin::String::toQString
|
||||
QString convertToQString(bool i18n = false) const;
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace BlackMisc
|
||||
return this->m_icaoCode;
|
||||
}
|
||||
|
||||
int CAirportIcaoCode::comparePropertyByIndex(const CAirportIcaoCode &compareValue, const CPropertyIndex &index) const
|
||||
int CAirportIcaoCode::comparePropertyByIndex(const CPropertyIndex &index, const CAirportIcaoCode &compareValue) const
|
||||
{
|
||||
Q_UNUSED(index);
|
||||
return this->m_icaoCode.compare(compareValue.getIcaoCode(), Qt::CaseInsensitive);
|
||||
|
||||
@@ -54,7 +54,7 @@ namespace BlackMisc
|
||||
QString convertToQString(bool i18n = false) const;
|
||||
|
||||
//! Compare for index
|
||||
int comparePropertyByIndex(const CAirportIcaoCode &compareValue, const CPropertyIndex &index) const;
|
||||
int comparePropertyByIndex(const CPropertyIndex &index, const CAirportIcaoCode &compareValue) const;
|
||||
|
||||
private:
|
||||
QString m_icaoCode;
|
||||
|
||||
@@ -383,7 +383,7 @@ namespace BlackMisc
|
||||
}
|
||||
}
|
||||
|
||||
void CAtcStation::setPropertyByIndex(const CVariant &variant, const BlackMisc::CPropertyIndex &index)
|
||||
void CAtcStation::setPropertyByIndex(const CPropertyIndex &index, const CVariant &variant)
|
||||
{
|
||||
if (index.isMyself()) { (*this) = variant.to<CAtcStation>(); return; }
|
||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
@@ -396,37 +396,37 @@ namespace BlackMisc
|
||||
this->setBookedUntilUtc(variant.value<QDateTime>());
|
||||
break;
|
||||
case IndexCallsign:
|
||||
this->m_callsign.setPropertyByIndex(variant, index.copyFrontRemoved());
|
||||
this->m_callsign.setPropertyByIndex(index.copyFrontRemoved(), variant);
|
||||
break;
|
||||
case IndexController:
|
||||
this->m_controller.setPropertyByIndex(variant, index.copyFrontRemoved());
|
||||
this->m_controller.setPropertyByIndex(index.copyFrontRemoved(), variant);
|
||||
break;
|
||||
case IndexFrequency:
|
||||
this->m_frequency.setPropertyByIndex(variant, index.copyFrontRemoved());
|
||||
this->m_frequency.setPropertyByIndex(index.copyFrontRemoved(), variant);
|
||||
break;
|
||||
case IndexIsOnline:
|
||||
this->setOnline(variant.value<bool>());
|
||||
break;
|
||||
case IndexPosition:
|
||||
this->m_position.setPropertyByIndex(variant, index.copyFrontRemoved());
|
||||
this->m_position.setPropertyByIndex(index.copyFrontRemoved(), variant);
|
||||
break;
|
||||
case IndexRange:
|
||||
this->m_range.setPropertyByIndex(variant, index.copyFrontRemoved());
|
||||
this->m_range.setPropertyByIndex(index.copyFrontRemoved(), variant);
|
||||
break;
|
||||
case IndexDistanceToOwnAircraft:
|
||||
this->m_distanceToOwnAircraft.setPropertyByIndex(variant, index.copyFrontRemoved());
|
||||
this->m_distanceToOwnAircraft.setPropertyByIndex(index.copyFrontRemoved(), variant);
|
||||
break;
|
||||
case IndexAtis:
|
||||
this->m_atis.setPropertyByIndex(variant, index.copyFrontRemoved());
|
||||
this->m_atis.setPropertyByIndex(index.copyFrontRemoved(), variant);
|
||||
break;
|
||||
case IndexMetar:
|
||||
this->m_metar.setPropertyByIndex(variant, index.copyFrontRemoved());
|
||||
this->m_metar.setPropertyByIndex(index.copyFrontRemoved(), variant);
|
||||
break;
|
||||
case IndexVoiceRoom:
|
||||
this->m_voiceRoom.setPropertyByIndex(variant, index.copyFrontRemoved());
|
||||
this->m_voiceRoom.setPropertyByIndex(index.copyFrontRemoved(), variant);
|
||||
break;
|
||||
default:
|
||||
CValueObject::setPropertyByIndex(variant, index);
|
||||
CValueObject::setPropertyByIndex(index, variant);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -240,7 +240,7 @@ namespace BlackMisc
|
||||
CVariant propertyByIndex(const BlackMisc::CPropertyIndex &index) const;
|
||||
|
||||
//! \copydoc BlackMisc::Mixin::Index::setPropertyByIndex
|
||||
void setPropertyByIndex(const CVariant &variant, const CPropertyIndex &index);
|
||||
void setPropertyByIndex(const CPropertyIndex &index, const CVariant &variant);
|
||||
|
||||
//! \copydoc BlackMisc::Mixin::String::toQString
|
||||
QString convertToQString(bool i18n = false) const;
|
||||
|
||||
@@ -148,7 +148,7 @@ namespace BlackMisc
|
||||
}
|
||||
}
|
||||
|
||||
void CCallsign::setPropertyByIndex(const CVariant &variant, const CPropertyIndex &index)
|
||||
void CCallsign::setPropertyByIndex(const CPropertyIndex &index, const CVariant &variant)
|
||||
{
|
||||
if (index.isMyself()) { (*this) = variant.to<CCallsign>(); return; }
|
||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
@@ -164,11 +164,11 @@ namespace BlackMisc
|
||||
this->m_telephonyDesignator = variant.toQString();
|
||||
break;
|
||||
default:
|
||||
return CValueObject::setPropertyByIndex(variant, index);
|
||||
return CValueObject::setPropertyByIndex(index, variant);
|
||||
}
|
||||
}
|
||||
|
||||
int CCallsign::comparePropertyByIndex(const CCallsign &compareValue, const CPropertyIndex &index) const
|
||||
int CCallsign::comparePropertyByIndex(const CPropertyIndex &index, const CCallsign &compareValue) const
|
||||
{
|
||||
if (index.isMyself()) { return this->m_callsign.compare(compareValue.m_callsign, Qt::CaseInsensitive); }
|
||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
|
||||
@@ -114,10 +114,10 @@ namespace BlackMisc
|
||||
CVariant propertyByIndex(const BlackMisc::CPropertyIndex &index) const;
|
||||
|
||||
//! \copydoc BlackMisc::Mixin::Index::setPropertyByIndex
|
||||
void setPropertyByIndex(const CVariant &variant, const BlackMisc::CPropertyIndex &index);
|
||||
void setPropertyByIndex(const BlackMisc::CPropertyIndex &index, const CVariant &variant);
|
||||
|
||||
//! Compare for index
|
||||
int comparePropertyByIndex(const CCallsign &compareValue, const CPropertyIndex &index) const;
|
||||
int comparePropertyByIndex(const CPropertyIndex &index, const CCallsign &compareValue) const;
|
||||
|
||||
//! Valid callsign?
|
||||
bool isValid() const;
|
||||
|
||||
@@ -245,10 +245,10 @@ namespace BlackMisc
|
||||
}
|
||||
}
|
||||
|
||||
void CLivery::setPropertyByIndex(const CVariant &variant, const BlackMisc::CPropertyIndex &index)
|
||||
void CLivery::setPropertyByIndex(const CPropertyIndex &index, const CVariant &variant)
|
||||
{
|
||||
if (index.isMyself()) { (*this) = variant.to<CLivery>(); return; }
|
||||
if (IDatastoreObjectWithIntegerKey::canHandleIndex(index)) { IDatastoreObjectWithIntegerKey::setPropertyByIndex(variant, index); return; }
|
||||
if (IDatastoreObjectWithIntegerKey::canHandleIndex(index)) { IDatastoreObjectWithIntegerKey::setPropertyByIndex(index, variant); return; }
|
||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
switch (i)
|
||||
{
|
||||
@@ -256,13 +256,13 @@ namespace BlackMisc
|
||||
this->m_description = variant.toQString(false);
|
||||
break;
|
||||
case IndexAirlineIcaoCode:
|
||||
this->m_airline.setPropertyByIndex(variant, index.copyFrontRemoved());
|
||||
this->m_airline.setPropertyByIndex(index.copyFrontRemoved(), variant);
|
||||
break;
|
||||
case IndexColorFuselage:
|
||||
this->m_colorFuselage.setPropertyByIndex(variant, index.copyFrontRemoved());
|
||||
this->m_colorFuselage.setPropertyByIndex(index.copyFrontRemoved(), variant);
|
||||
break;
|
||||
case IndexColorTail:
|
||||
this->m_colorTail.setPropertyByIndex(variant, index.copyFrontRemoved());
|
||||
this->m_colorTail.setPropertyByIndex(index.copyFrontRemoved(), variant);
|
||||
break;
|
||||
case IndexCombinedCode:
|
||||
this->setCombinedCode(variant.toQString(false));
|
||||
@@ -271,26 +271,26 @@ namespace BlackMisc
|
||||
this->setMilitary(variant.toBool());
|
||||
break;
|
||||
default:
|
||||
CValueObject::setPropertyByIndex(variant, index);
|
||||
CValueObject::setPropertyByIndex(index, variant);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
int CLivery::comparePropertyByIndex(const CLivery &compareValue, const CPropertyIndex &index) const
|
||||
int CLivery::comparePropertyByIndex(const CPropertyIndex &index, const CLivery &compareValue) const
|
||||
{
|
||||
if (index.isMyself()) { return this->getCombinedCode().compare(compareValue.getCombinedCode()); }
|
||||
if (IDatastoreObjectWithIntegerKey::canHandleIndex(index)) { return IDatastoreObjectWithIntegerKey::comparePropertyByIndex(compareValue, index);}
|
||||
if (IDatastoreObjectWithIntegerKey::canHandleIndex(index)) { return IDatastoreObjectWithIntegerKey::comparePropertyByIndex(index, compareValue);}
|
||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
switch (i)
|
||||
{
|
||||
case IndexDescription:
|
||||
return this->m_description.compare(compareValue.getDescription(), Qt::CaseInsensitive);
|
||||
case IndexAirlineIcaoCode:
|
||||
return this->m_airline.comparePropertyByIndex(compareValue.getAirlineIcaoCode(), index.copyFrontRemoved());
|
||||
return this->m_airline.comparePropertyByIndex(index.copyFrontRemoved(), compareValue.getAirlineIcaoCode());
|
||||
case IndexColorFuselage:
|
||||
return this->m_colorFuselage.comparePropertyByIndex(compareValue.getColorFuselage(), index.copyFrontRemoved());
|
||||
return this->m_colorFuselage.comparePropertyByIndex(index.copyFrontRemoved(), compareValue.getColorFuselage());
|
||||
case IndexColorTail:
|
||||
return this->m_colorTail.comparePropertyByIndex(compareValue.getColorTail(), index.copyFrontRemoved());
|
||||
return this->m_colorTail.comparePropertyByIndex(index.copyFrontRemoved(), compareValue.getColorTail());
|
||||
case IndexCombinedCode:
|
||||
return this->getCombinedCode().compare(compareValue.getCombinedCode());
|
||||
case IndexIsMilitary:
|
||||
|
||||
@@ -113,10 +113,10 @@ namespace BlackMisc
|
||||
CVariant propertyByIndex(const BlackMisc::CPropertyIndex &index) const;
|
||||
|
||||
//! \copydoc BlackMisc::Mixin::Index::setPropertyByIndex
|
||||
void setPropertyByIndex(const CVariant &variant, const BlackMisc::CPropertyIndex &index);
|
||||
void setPropertyByIndex(const BlackMisc::CPropertyIndex &index, const CVariant &variant);
|
||||
|
||||
//! Compare for index
|
||||
int comparePropertyByIndex(const CLivery &compareValue, const CPropertyIndex &index) const;
|
||||
int comparePropertyByIndex(const CPropertyIndex &index, const CLivery &compareValue) const;
|
||||
|
||||
//! \copydoc BlackMisc::Mixin::String::toQString
|
||||
QString convertToQString(bool i18n = false) const;
|
||||
|
||||
@@ -125,17 +125,17 @@ namespace BlackMisc
|
||||
}
|
||||
|
||||
template <class AVIO>
|
||||
void CModulator<AVIO>::setPropertyByIndex(const CVariant &variant, const CPropertyIndex &index)
|
||||
void CModulator<AVIO>::setPropertyByIndex(const CPropertyIndex &index, const CVariant &variant)
|
||||
{
|
||||
if (index.isMyself()) { Q_ASSERT_X(false, Q_FUNC_INFO, "Wrong index to base template"); return; }
|
||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
switch (i)
|
||||
{
|
||||
case IndexActiveFrequency:
|
||||
this->m_frequencyActive.setPropertyByIndex(variant, index.copyFrontRemoved());
|
||||
this->m_frequencyActive.setPropertyByIndex(index.copyFrontRemoved(), variant);
|
||||
break;
|
||||
case IndexStandbyFrequency:
|
||||
this->m_frequencyStandby.setPropertyByIndex(variant, index.copyFrontRemoved());
|
||||
this->m_frequencyStandby.setPropertyByIndex(index.copyFrontRemoved(), variant);
|
||||
break;
|
||||
case IndexEnabled:
|
||||
this->setEnabled(variant.toBool());
|
||||
@@ -147,7 +147,7 @@ namespace BlackMisc
|
||||
this->setVolumeOutput(variant.toInt());
|
||||
break;
|
||||
default:
|
||||
CValueObject<CModulator<AVIO>>::setPropertyByIndex(variant, index);
|
||||
CValueObject<CModulator<AVIO>>::setPropertyByIndex(index, variant);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ namespace BlackMisc
|
||||
CVariant propertyByIndex(const BlackMisc::CPropertyIndex &index) const;
|
||||
|
||||
//! \copydoc BlackMisc::Mixin::Index::setPropertyByIndex
|
||||
void setPropertyByIndex(const CVariant &variant, const BlackMisc::CPropertyIndex &index);
|
||||
void setPropertyByIndex(const BlackMisc::CPropertyIndex &index, const CVariant &variant);
|
||||
|
||||
//! \copydoc BlackMisc::Mixin::String::toQString
|
||||
QString convertToQString(bool i18n = false) const;
|
||||
|
||||
@@ -16,7 +16,6 @@ namespace BlackMisc
|
||||
{
|
||||
namespace Aviation
|
||||
{
|
||||
|
||||
QString CTrack::convertToQString(bool i18n) const
|
||||
{
|
||||
QString s = CAngle::convertToQString(i18n).append(" ");
|
||||
@@ -31,6 +30,5 @@ namespace BlackMisc
|
||||
return s.append(this->isMagneticTrack() ? "magnetic" : "true");
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
@@ -173,7 +173,7 @@ namespace BlackMisc
|
||||
return CVariant::fromValue(m);
|
||||
}
|
||||
|
||||
void CTransponder::setPropertyByIndex(const CVariant &variant, const CPropertyIndex &index)
|
||||
void CTransponder::setPropertyByIndex(const CPropertyIndex &index, const CVariant &variant)
|
||||
{
|
||||
if (index.isMyself()) { (*this) = variant.to<CTransponder>(); return; }
|
||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
|
||||
@@ -158,7 +158,7 @@ namespace BlackMisc
|
||||
CVariant propertyByIndex(const BlackMisc::CPropertyIndex &index) const;
|
||||
|
||||
//! \copydoc BlackMisc::Mixin::Index::setPropertyByIndex
|
||||
void setPropertyByIndex(const CVariant &variant, const BlackMisc::CPropertyIndex &index);
|
||||
void setPropertyByIndex(const BlackMisc::CPropertyIndex &index, const CVariant &variant);
|
||||
|
||||
//! Is valid transponder code?
|
||||
static bool isValidTransponderCode(const QString &transponderCode);
|
||||
|
||||
Reference in New Issue
Block a user