refs #655, Change signature (order) of setProperty/compareProperty

This commit is contained in:
Klaus Basan
2016-05-09 23:15:39 +02:00
committed by Roland Winklmeier
parent 49094115b1
commit 0f5d2a29a8
114 changed files with 324 additions and 331 deletions

View File

@@ -233,12 +233,12 @@ namespace BlackCore
}
}
void CGlobalSetup::setPropertyByIndex(const CVariant &variant, const BlackMisc::CPropertyIndex &index)
void CGlobalSetup::setPropertyByIndex(const CPropertyIndex &index, const CVariant &variant)
{
if (index.isMyself()) { (*this) = variant.to<CGlobalSetup>(); return; }
if (ITimestampBased::canHandleIndex(index))
{
ITimestampBased::setPropertyByIndex(variant, index);
ITimestampBased::setPropertyByIndex(index, variant);
return;
}
@@ -246,7 +246,7 @@ namespace BlackCore
switch (i)
{
case IndexDbRootDirectory:
this->m_dbRootDirectoryUrl.setPropertyByIndex(variant, index.copyFrontRemoved());
this->m_dbRootDirectoryUrl.setPropertyByIndex(index.copyFrontRemoved(), variant);
break;
case IndexDbHttpPort:
this->m_dbHttpPort = variant.toInt();
@@ -260,7 +260,7 @@ namespace BlackCore
this->m_vatsimDataFileUrls = variant.value<CUrlList>();
break;
case IndexVatsimBookings:
this->m_vatsimBookingsUrl.setPropertyByIndex(variant, index.copyFrontRemoved());
this->m_vatsimBookingsUrl.setPropertyByIndex(index.copyFrontRemoved(), variant);
break;
case IndexVatsimMetars:
this->m_vatsimMetarsUrls = variant.value<CUrlList>();
@@ -272,7 +272,7 @@ namespace BlackCore
this->m_wasLoaded = variant.toBool();
break;
default:
CValueObject::setPropertyByIndex(variant, index);
CValueObject::setPropertyByIndex(index, variant);
break;
}
}

View File

@@ -136,7 +136,7 @@ namespace BlackCore
BlackMisc::CVariant propertyByIndex(const BlackMisc::CPropertyIndex &index) const;
//! \copydoc BlackMisc::Mixin::Index::setPropertyByIndex
void setPropertyByIndex(const BlackMisc::CVariant &variant, const BlackMisc::CPropertyIndex &index);
void setPropertyByIndex(const BlackMisc::CPropertyIndex &index, const BlackMisc::CVariant &variant);
//! Schema version
static const QString &versionString();

View File

@@ -99,12 +99,12 @@ namespace BlackCore
}
}
void CUpdateInfo::setPropertyByIndex(const CVariant &variant, const BlackMisc::CPropertyIndex &index)
void CUpdateInfo::setPropertyByIndex(const CPropertyIndex &index, const CVariant &variant)
{
if (index.isMyself()) { (*this) = variant.to<CUpdateInfo>(); return; }
if (ITimestampBased::canHandleIndex(index))
{
ITimestampBased::setPropertyByIndex(variant, index);
ITimestampBased::setPropertyByIndex(index, variant);
return;
}
@@ -130,7 +130,7 @@ namespace BlackCore
this->m_latestVersionBeta = variant.toQString();
break;
default:
CValueObject::setPropertyByIndex(variant, index);
CValueObject::setPropertyByIndex(index, variant);
break;
}
}

View File

@@ -88,7 +88,7 @@ namespace BlackCore
BlackMisc::CVariant propertyByIndex(const BlackMisc::CPropertyIndex &index) const;
//! \copydoc BlackMisc::Mixin::Index::setPropertyByIndex
void setPropertyByIndex(const BlackMisc::CVariant &variant, const BlackMisc::CPropertyIndex &index);
void setPropertyByIndex(const BlackMisc::CPropertyIndex &index, const BlackMisc::CVariant &variant);
private:
bool m_development = false; //!< for development

View File

@@ -59,12 +59,12 @@ namespace BlackCore
}
}
void CVatsimSetup::setPropertyByIndex(const CVariant &variant, const BlackMisc::CPropertyIndex &index)
void CVatsimSetup::setPropertyByIndex(const CPropertyIndex &index, const CVariant &variant)
{
if (index.isMyself()) { (*this) = variant.to<CVatsimSetup>(); return; }
if (ITimestampBased::canHandleIndex(index))
{
ITimestampBased::setPropertyByIndex(variant, index);
ITimestampBased::setPropertyByIndex(index, variant);
return;
}
@@ -78,7 +78,7 @@ namespace BlackCore
this->m_dataFileUrls = variant.value<CUrlList>();
break;
default:
CValueObject::setPropertyByIndex(variant, index);
CValueObject::setPropertyByIndex(index, variant);
break;
}
}

View File

@@ -93,7 +93,7 @@ namespace BlackCore
BlackMisc::CVariant propertyByIndex(const BlackMisc::CPropertyIndex &index) const;
//! \copydoc BlackMisc::Mixin::Index::setPropertyByIndex
void setPropertyByIndex(const BlackMisc::CVariant &variant, const BlackMisc::CPropertyIndex &index);
void setPropertyByIndex(const BlackMisc::CPropertyIndex &index, const BlackMisc::CVariant &variant);
private:
BlackMisc::Network::CUrlList m_serverFileUrls; //!< only the FSD servers

View File

@@ -282,7 +282,7 @@ namespace BlackGui
ObjectType obj = this->m_container[index.row()];
ObjectType currentObject(obj);
BlackMisc::CPropertyIndex propertyIndex = this->columnToPropertyIndex(index.column());
obj.setPropertyByIndex(value, propertyIndex);
obj.setPropertyByIndex(propertyIndex, value);
if (obj != currentObject)
{

View File

@@ -298,7 +298,7 @@ namespace BlackGui
template<class ObjectType>
bool compareForModelSort(const ObjectType &a, const ObjectType &b, Qt::SortOrder order, const BlackMisc::CPropertyIndex &index, std::true_type)
{
int c = a.comparePropertyByIndex(b, index);
int c = a.comparePropertyByIndex(index, b);
if (c == 0) { return false; }
return (order == Qt::AscendingOrder) ? (c < 0) : (c > 0);
}

View File

@@ -786,10 +786,10 @@ namespace BlackGui
if (!hasSelection()) { return 0; }
int c = 0;
QModelIndexList indexes = this->selectedRows();
int lastUpdatedRow = -1;
int firstUpdatedRow = -1;
const CPropertyIndexList pis(vm.indexes());
const CPropertyIndexList propertyIndexes(vm.indexes());
const QModelIndexList indexes = this->selectedRows();
for (const QModelIndex &i : indexes)
{
@@ -799,9 +799,9 @@ namespace BlackGui
ObjectType obj(this->at(i));
// update all properties in map
for (const CPropertyIndex &pi : pis)
for (const CPropertyIndex &pi : propertyIndexes)
{
obj.setPropertyByIndex(vm.value(pi), pi);
obj.setPropertyByIndex(pi, vm.value(pi));
}
// and update container

View File

@@ -46,7 +46,7 @@ namespace BlackMisc
}
}
void CVoiceRoom::setPropertyByIndex(const CVariant &variant, const CPropertyIndex &index)
void CVoiceRoom::setPropertyByIndex(const CPropertyIndex &index, const CVariant &variant)
{
if (index.isMyself()) { (*this) = variant.to<CVoiceRoom>(); return; }
ColumnIndex i = index.frontCasted<ColumnIndex>();
@@ -68,7 +68,7 @@ namespace BlackMisc
this->setVoiceRoomUrl(variant.value<QString>());
break;
default:
CValueObject::setPropertyByIndex(variant, index);
CValueObject::setPropertyByIndex(index, variant);
break;
}
}

View File

@@ -89,7 +89,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);
//! Protocol prefix "vvl"
static const QString &protocol() { static QString p("vvl"); return p; }

View File

@@ -84,7 +84,6 @@ namespace BlackMisc
this->isValidFrequency(this->getFrequencyStandby());
}
};
}
}

View File

@@ -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)
{

View File

@@ -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;

View File

@@ -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;
}
}

View File

@@ -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; }

View File

@@ -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)

View File

@@ -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; }

View File

@@ -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;
}
}

View File

@@ -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; }

View File

@@ -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

View File

@@ -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;

View File

@@ -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;
}

View File

@@ -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;

View File

@@ -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);

View File

@@ -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;

View File

@@ -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;
}
}

View File

@@ -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;

View File

@@ -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>();

View File

@@ -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;

View File

@@ -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:

View File

@@ -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;

View File

@@ -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;
}
}

View File

@@ -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;

View File

@@ -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

View File

@@ -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>();

View File

@@ -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);

View File

@@ -12,7 +12,6 @@
namespace BlackMisc
{
CCountry::CCountry(const QString &iso, const QString &name) :
IDatastoreObjectWithStringKey(iso.trimmed().toUpper()),
m_name(name.trimmed())
@@ -110,7 +109,7 @@ namespace BlackMisc
}
}
void CCountry::setPropertyByIndex(const CVariant &variant, const BlackMisc::CPropertyIndex &index)
void CCountry::setPropertyByIndex(const CPropertyIndex &index, const CVariant &variant)
{
if (index.isMyself()) { (*this) = variant.to<CCountry>(); return; }
ColumnIndex i = index.frontCasted<ColumnIndex>();
@@ -124,16 +123,16 @@ namespace BlackMisc
break;
default:
return (IDatastoreObjectWithStringKey::canHandleIndex(index)) ?
IDatastoreObjectWithStringKey::setPropertyByIndex(variant, index) :
CValueObject::setPropertyByIndex(variant, index);
IDatastoreObjectWithStringKey::setPropertyByIndex(index, variant) :
CValueObject::setPropertyByIndex(index, variant);
break;
}
}
int CCountry::comparePropertyByIndex(const CCountry &compareValue, const CPropertyIndex &index) const
int CCountry::comparePropertyByIndex(const CPropertyIndex &index, const CCountry &compareValue) const
{
if (index.isMyself()) { return getIsoCode().compare(compareValue.getIsoCode(), Qt::CaseInsensitive); }
if (IDatastoreObjectWithStringKey::canHandleIndex(index)) { return IDatastoreObjectWithStringKey::comparePropertyByIndex(compareValue, index);}
if (IDatastoreObjectWithStringKey::canHandleIndex(index)) { return IDatastoreObjectWithStringKey::comparePropertyByIndex(index, compareValue);}
ColumnIndex i = index.frontCasted<ColumnIndex>();
switch (i)
{
@@ -165,5 +164,4 @@ namespace BlackMisc
{
return isoCode.length() == 2;
}
} // namespace

View File

@@ -76,13 +76,13 @@ namespace BlackMisc
QString convertToQString(bool i18n = false) const;
//! \copydoc BlackMisc::Mixin::Index::propertyByIndex
CVariant propertyByIndex(const BlackMisc::CPropertyIndex &index) const;
CVariant propertyByIndex(const CPropertyIndex &index) const;
//! \copydoc BlackMisc::Mixin::Index::setPropertyByIndex
void setPropertyByIndex(const CVariant &variant, const BlackMisc::CPropertyIndex &index);
void setPropertyByIndex(const CPropertyIndex &index, const CVariant &variant);
//! Compare for index
int comparePropertyByIndex(const CCountry &compareValue, const CPropertyIndex &index) const;
int comparePropertyByIndex(const CPropertyIndex &index, const CCountry &compareValue) const;
//! From our database JSON format
static CCountry fromDatabaseJson(const QJsonObject &json, const QString &prefix = QString());

View File

@@ -82,9 +82,9 @@ namespace BlackMisc
return CVariant();
}
void IDatastoreObjectWithIntegerKey::setPropertyByIndex(const CVariant &variant, const CPropertyIndex &index)
void IDatastoreObjectWithIntegerKey::setPropertyByIndex(const CPropertyIndex &index, const CVariant &variant)
{
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)
{
@@ -96,14 +96,14 @@ namespace BlackMisc
}
}
int IDatastoreObjectWithIntegerKey::comparePropertyByIndex(const IDatastoreObjectWithIntegerKey &compareValue, const CPropertyIndex &index) const
int IDatastoreObjectWithIntegerKey::comparePropertyByIndex(const CPropertyIndex &index, const IDatastoreObjectWithIntegerKey &compareValue) const
{
if (ITimestampBased::canHandleIndex(index)) { return ITimestampBased::comparePropertyByIndex(compareValue, index); }
ColumnIndex i = index.frontCasted<ColumnIndex>();
if (ITimestampBased::canHandleIndex(index)) { return ITimestampBased::comparePropertyByIndex(index, compareValue); }
const ColumnIndex i = index.frontCasted<ColumnIndex>();
switch (i)
{
case IndexDbIntegerKey: return Compare::compare(this->m_dbKey, compareValue.getDbKey());
case IndexDatabaseIcon: return Compare::compare(this->hasValidDbKey(), compareValue.hasValidDbKey());
case IndexDbIntegerKey: return Compare::compare(this->m_dbKey, compareValue.getDbKey());
case IndexDatabaseIcon: return Compare::compare(this->hasValidDbKey(), compareValue.hasValidDbKey());
default: break;
}
Q_ASSERT_X(false, Q_FUNC_INFO, "Compare failed");
@@ -158,9 +158,9 @@ namespace BlackMisc
return CVariant();
}
void IDatastoreObjectWithStringKey::setPropertyByIndex(const CVariant &variant, const CPropertyIndex &index)
void IDatastoreObjectWithStringKey::setPropertyByIndex(const CPropertyIndex &index, const CVariant &variant)
{
if (ITimestampBased::canHandleIndex(index)) { ITimestampBased::setPropertyByIndex(variant, index); return; }
if (ITimestampBased::canHandleIndex(index)) { ITimestampBased::setPropertyByIndex(index, variant); return; }
const ColumnIndex i = index.frontCasted<ColumnIndex>();
switch (i)
{
@@ -172,9 +172,9 @@ namespace BlackMisc
}
}
int IDatastoreObjectWithStringKey::comparePropertyByIndex(const IDatastoreObjectWithStringKey &compareValue, const CPropertyIndex &index) const
int IDatastoreObjectWithStringKey::comparePropertyByIndex(const CPropertyIndex &index, const IDatastoreObjectWithStringKey &compareValue) const
{
if (ITimestampBased::canHandleIndex(index)) { return ITimestampBased::comparePropertyByIndex(compareValue, index); }
if (ITimestampBased::canHandleIndex(index)) { return ITimestampBased::comparePropertyByIndex(index, compareValue); }
const ColumnIndex i = index.frontCasted<ColumnIndex>();
switch (i)
{

View File

@@ -79,10 +79,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 by index
int comparePropertyByIndex(const IDatastoreObjectWithIntegerKey &compareValue, const CPropertyIndex &index) const;
int comparePropertyByIndex(const CPropertyIndex &index, const IDatastoreObjectWithIntegerKey &compareValue) const;
//! Can given index be handled?
static bool canHandleIndex(const BlackMisc::CPropertyIndex &index);
@@ -138,10 +138,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 by index
int comparePropertyByIndex(const IDatastoreObjectWithStringKey &compareValue, const BlackMisc::CPropertyIndex &index) const;
int comparePropertyByIndex(const BlackMisc::CPropertyIndex &index, const IDatastoreObjectWithStringKey &compareValue) const;
//! Can given index be handled
static bool canHandleIndex(const BlackMisc::CPropertyIndex &index);

View File

@@ -125,14 +125,14 @@ namespace BlackMisc
}
}
void CCoordinateGeodetic::setPropertyByIndex(const CVariant &variant, const BlackMisc::CPropertyIndex &index)
void CCoordinateGeodetic::setPropertyByIndex(const CPropertyIndex &index, const CVariant &variant)
{
if (index.isMyself()) { (*this) = variant.to<CCoordinateGeodetic>(); return; }
ICoordinateGeodetic::ColumnIndex i = index.frontCasted<ICoordinateGeodetic::ColumnIndex>();
switch (i)
{
case IndexGeodeticHeight:
this->m_geodeticHeight.setPropertyByIndex(variant, index.copyFrontRemoved());
this->m_geodeticHeight.setPropertyByIndex(index.copyFrontRemoved(), variant);
break;
case IndexLatitude:
this->setLatitude(variant.value<CLatitude>());
@@ -153,7 +153,7 @@ namespace BlackMisc
this->setNormalVector(variant.value<QVector3D>());
break;
default:
CValueObject::setPropertyByIndex(variant, index);
CValueObject::setPropertyByIndex(index, variant);
break;
}
}

View File

@@ -179,7 +179,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);
//! Switch unit of height
CCoordinateGeodetic &switchUnit(const BlackMisc::PhysicalQuantities::CLengthUnit &unit);

View File

@@ -109,9 +109,9 @@ namespace BlackMisc
}
}
void CIdentifier::setPropertyByIndex(const CVariant &variant, const BlackMisc::CPropertyIndex &index)
void CIdentifier::setPropertyByIndex(const CPropertyIndex &index, const CVariant &variant)
{
CValueObject::setPropertyByIndex(variant, index);
CValueObject::setPropertyByIndex(index, variant);
}
} // ns

View File

@@ -89,7 +89,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);
private:
QString m_name; //!< object name

View File

@@ -67,7 +67,7 @@ namespace BlackMisc
}
}
void CActionHotkey::setPropertyByIndex(const CVariant &variant, const BlackMisc::CPropertyIndex &index)
void CActionHotkey::setPropertyByIndex(const CPropertyIndex &index, const CVariant &variant)
{
if (index.isMyself()) { (*this) = variant.to<CActionHotkey>(); return; }
ColumnIndex i = index.frontCasted<ColumnIndex>();
@@ -85,7 +85,7 @@ namespace BlackMisc
this->setObject(variant.value<CActionHotkey>());
break;
default:
CValueObject::setPropertyByIndex(variant, index);
CValueObject::setPropertyByIndex(index, variant);
break;
}
}

View File

@@ -72,7 +72,7 @@ namespace BlackMisc
bool isValid() const { return !m_identifier.getMachineName().isEmpty() && !m_combination.isEmpty() && !m_action.isEmpty(); }
//! \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::Index::propertyByIndex
CVariant propertyByIndex(const BlackMisc::CPropertyIndex &index) const;

View File

@@ -29,7 +29,7 @@ namespace BlackMisc
this->m_buttonIndex = button.m_buttonIndex;
}
void CJoystickButton::setPropertyByIndex(const CVariant &variant, const CPropertyIndex &index)
void CJoystickButton::setPropertyByIndex(const CPropertyIndex &index, const CVariant &variant)
{
if (index.isMyself()) { (*this) = variant.to<CJoystickButton>(); return; }
ColumnIndex i = index.frontCasted<ColumnIndex>();

View File

@@ -54,7 +54,7 @@ namespace BlackMisc
void setButtonObject(const CJoystickButton &button);
//! \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::Index::propertyByIndex
CVariant propertyByIndex(const CPropertyIndex &index) const;

View File

@@ -86,7 +86,7 @@ namespace BlackMisc
return CVariant::fromValue(m);
}
void CKeyboardKey::setPropertyByIndex(const CVariant &variant, const BlackMisc::CPropertyIndex &index)
void CKeyboardKey::setPropertyByIndex(const CPropertyIndex &index, const CVariant &variant)
{
if (index.isMyself()) { (*this) = variant.to<CKeyboardKey>(); return; }
ColumnIndex i = index.frontCasted<ColumnIndex>();

View File

@@ -73,7 +73,7 @@ namespace BlackMisc
void setKeyObject(const CKeyboardKey &key);
//! \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::Index::propertyByIndex
CVariant propertyByIndex(const BlackMisc::CPropertyIndex &index) const;

View File

@@ -12,7 +12,6 @@
namespace BlackMisc
{
CNameVariantPair::CNameVariantPair(const QString &name, const CVariant &variant, const CIcon &icon)
: m_name(name), m_variant(variant), m_icon(icon)
{ }
@@ -46,7 +45,7 @@ namespace BlackMisc
}
}
void CNameVariantPair::setPropertyByIndex(const CVariant &variant, const BlackMisc::CPropertyIndex &index)
void CNameVariantPair::setPropertyByIndex(const CPropertyIndex &index, const CVariant &variant)
{
if (index.isMyself()) { (*this) = variant.to<CNameVariantPair>(); return; }
ColumnIndex i = index.frontCasted<ColumnIndex>();
@@ -77,7 +76,7 @@ namespace BlackMisc
this->m_variant = variant;
break;
default:
CValueObject::setPropertyByIndex(variant, index);
CValueObject::setPropertyByIndex(index, variant);
break;
}
}

View File

@@ -61,7 +61,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;

View File

@@ -119,10 +119,10 @@ namespace BlackMisc
}
}
void CAuthenticatedUser::setPropertyByIndex(const CVariant &variant, const BlackMisc::CPropertyIndex &index)
void CAuthenticatedUser::setPropertyByIndex(const CPropertyIndex &index, const CVariant &variant)
{
if (index.isMyself()) { (*this) = variant.to<CAuthenticatedUser>(); 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)
{
@@ -139,7 +139,7 @@ namespace BlackMisc
this->setRealName(variant.value<QString>());
break;
default:
CValueObject::setPropertyByIndex(variant, index);
CValueObject::setPropertyByIndex(index, variant);
break;
}
}

View File

@@ -137,7 +137,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;

View File

@@ -99,7 +99,7 @@ namespace BlackMisc
}
}
void CClient::setPropertyByIndex(const CVariant &variant, const BlackMisc::CPropertyIndex &index)
void CClient::setPropertyByIndex(const CPropertyIndex &index, const CVariant &variant)
{
if (index.isMyself()) { (*this) = variant.to<CClient>(); return; }
ColumnIndex i = index.frontCasted<ColumnIndex>();
@@ -109,22 +109,22 @@ namespace BlackMisc
this->m_capabilities = variant.value<CPropertyIndexVariantMap>();
break;
case IndexModel:
this->m_model.setPropertyByIndex(variant, index.copyFrontRemoved());;
this->m_model.setPropertyByIndex(index.copyFrontRemoved(), variant);;
break;
case IndexServer:
this->m_server = variant.toQString();
break;
case IndexUser:
this->m_user.setPropertyByIndex(variant, index.copyFrontRemoved());
this->m_user.setPropertyByIndex(index.copyFrontRemoved(), variant);
break;
case IndexCallsign:
this->m_user.setCallsign(variant.value<BlackMisc::Aviation::CCallsign>());
break;
case IndexVoiceCapabilities:
this->m_voiceCapabilities.setPropertyByIndex(variant, index.copyFrontRemoved());
this->m_voiceCapabilities.setPropertyByIndex(index.copyFrontRemoved(), variant);
break;
default:
CValueObject::setPropertyByIndex(variant, index);
CValueObject::setPropertyByIndex(index, variant);
break;
}
}

View File

@@ -124,7 +124,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;

View File

@@ -41,10 +41,10 @@ namespace BlackMisc
}
}
void CRole::setPropertyByIndex(const CVariant &variant, const CPropertyIndex &index)
void CRole::setPropertyByIndex(const CPropertyIndex &index, const CVariant &variant)
{
if (index.isMyself()) { (*this) = variant.to<CRole>(); 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)
{
@@ -54,7 +54,7 @@ namespace BlackMisc
case IndexDescription:
this->setDescription(variant.value<QString>());
default:
CValueObject::setPropertyByIndex(variant, index);
CValueObject::setPropertyByIndex(index, variant);
break;
}
}

View File

@@ -61,7 +61,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);
//! Role from DB JSON
static CRole fromDatabaseJson(const QJsonObject &json);

View File

@@ -91,7 +91,7 @@ namespace BlackMisc
}
}
void CServer::setPropertyByIndex(const CVariant &variant, const BlackMisc::CPropertyIndex &index)
void CServer::setPropertyByIndex(const CPropertyIndex &index, const CVariant &variant)
{
if (index.isMyself()) { (*this) = variant.to<CServer>(); return; }
ColumnIndex i = index.frontCasted<ColumnIndex>();
@@ -110,13 +110,13 @@ namespace BlackMisc
this->setName(variant.value<QString>());
break;
case IndexUser:
this->m_user.setPropertyByIndex(variant, index.copyFrontRemoved());
this->m_user.setPropertyByIndex(index.copyFrontRemoved(), variant);
break;
case IndexIsAcceptingConnections:
this->setIsAcceptingConnections(variant.value<bool>());
break;
default:
CValueObject::setPropertyByIndex(variant, index);
CValueObject::setPropertyByIndex(index, variant);
break;
}
}

View File

@@ -101,7 +101,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;

View File

@@ -204,25 +204,25 @@ namespace BlackMisc
}
}
void CTextMessage::setPropertyByIndex(const CVariant &variant, const BlackMisc::CPropertyIndex &index)
void CTextMessage::setPropertyByIndex(const CPropertyIndex &index, const CVariant &variant)
{
if (index.isMyself()) { (*this) = variant.to<CTextMessage>(); 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)
{
case IndexSenderCallsign:
this->m_senderCallsign.setPropertyByIndex(variant, index.copyFrontRemoved());
this->m_senderCallsign.setPropertyByIndex(index.copyFrontRemoved(), variant);
break;
case IndexRecipientCallsign:
this->m_recipientCallsign.setPropertyByIndex(variant, index.copyFrontRemoved());
this->m_recipientCallsign.setPropertyByIndex(index.copyFrontRemoved(), variant);
break;
case IndexMessage:
this->m_message = variant.value<QString>();
break;
default:
CValueObject::setPropertyByIndex(variant, index);
CValueObject::setPropertyByIndex(index, variant);
break;
}
}

View File

@@ -157,7 +157,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;

View File

@@ -238,7 +238,7 @@ namespace BlackMisc
}
}
void CUrl::setPropertyByIndex(const CVariant &variant, const BlackMisc::CPropertyIndex &index)
void CUrl::setPropertyByIndex(const CPropertyIndex &index, const CVariant &variant)
{
if (index.isMyself()) { (*this) = variant.to<CUrl>(); return; }
ColumnIndex i = index.frontCasted<ColumnIndex>();
@@ -257,7 +257,7 @@ namespace BlackMisc
this->setScheme(variant.value<QString>());
break;
default:
CValueObject::setPropertyByIndex(variant, index);
CValueObject::setPropertyByIndex(index, variant);
break;
}
}

View File

@@ -130,7 +130,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;

View File

@@ -188,7 +188,7 @@ namespace BlackMisc
}
}
void CUser::setPropertyByIndex(const CVariant &variant, const BlackMisc::CPropertyIndex &index)
void CUser::setPropertyByIndex(const CPropertyIndex &index, const CVariant &variant)
{
if (index.isMyself()) { (*this) = variant.to<CUser>(); return; }
ColumnIndex i = index.frontCasted<ColumnIndex>();
@@ -207,18 +207,18 @@ namespace BlackMisc
this->setRealName(variant.value<QString>());
break;
case IndexHomebase:
this->m_homebase.setPropertyByIndex(variant, index.copyFrontRemoved());
this->m_homebase.setPropertyByIndex(index.copyFrontRemoved(), variant);
break;
case IndexCallsign:
this->m_callsign.setPropertyByIndex(variant, index.copyFrontRemoved());
this->m_callsign.setPropertyByIndex(index.copyFrontRemoved(), variant);
break;
default:
CValueObject::setPropertyByIndex(variant, index);
CValueObject::setPropertyByIndex(index, variant);
break;
}
}
int CUser::comparePropertyByIndex(const CUser &compareValue, const CPropertyIndex &index) const
int CUser::comparePropertyByIndex(const CPropertyIndex &index, const CUser &compareValue) const
{
if (index.isMyself()) { return this->getRealName().compare(compareValue.getRealName(), Qt::CaseInsensitive); }
ColumnIndex i = index.frontCasted<ColumnIndex>();
@@ -233,9 +233,9 @@ namespace BlackMisc
case IndexRealName:
return this->m_realname.compare(compareValue.getRealName(), Qt::CaseInsensitive);
case IndexHomebase:
return this->m_homebase.comparePropertyByIndex(compareValue.getHomebase(), index.copyFrontRemoved());
return this->m_homebase.comparePropertyByIndex(index.copyFrontRemoved(), compareValue.getHomebase());
case IndexCallsign:
return this->m_callsign.comparePropertyByIndex(compareValue.getCallsign(), index.copyFrontRemoved());
return this->m_callsign.comparePropertyByIndex(index.copyFrontRemoved(), compareValue.getCallsign());
default:
break;
}

View File

@@ -120,10 +120,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 by index
int comparePropertyByIndex(const CUser &compareValue, const CPropertyIndex &index) const;
int comparePropertyByIndex(const CPropertyIndex &index, const CUser &compareValue) const;
//! This and another user exchange missing data, This user has priority and overrides first.
void syncronizeData(CUser &otherUser);

View File

@@ -57,7 +57,7 @@ namespace BlackMisc
return CVariant::fromValue(m);
}
void IOrderable::setPropertyByIndex(const CVariant &variant, const CPropertyIndex &index)
void IOrderable::setPropertyByIndex(const CPropertyIndex &index, const CVariant &variant)
{
if (!index.isEmpty())
{
@@ -76,7 +76,7 @@ namespace BlackMisc
Q_ASSERT_X(false, Q_FUNC_INFO, m.toLocal8Bit().constData());
}
int IOrderable::comparePropertyByIndex(const IOrderable &compareValue, const CPropertyIndex &index) const
int IOrderable::comparePropertyByIndex(const CPropertyIndex &index, const IOrderable &compareValue) const
{
Q_UNUSED(index);
static const int max = std::numeric_limits<int>::max();

View File

@@ -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 IOrderable &compareValue, const CPropertyIndex &index) const;
int comparePropertyByIndex(const CPropertyIndex &index, const IOrderable &compareValue) const;
int m_order = -1; //!< order number
};

View File

@@ -369,7 +369,7 @@ namespace BlackMisc
}
template <class MU, class PQ>
void CPhysicalQuantity<MU, PQ>::setPropertyByIndex(const CVariant &variant, const CPropertyIndex &index)
void CPhysicalQuantity<MU, PQ>::setPropertyByIndex(const CPropertyIndex &index, const CVariant &variant)
{
if (index.isMyself()) { (*this) = variant.to<PQ>(); return; }
ColumnIndex i = index.frontCasted<ColumnIndex>();
@@ -389,13 +389,13 @@ namespace BlackMisc
this->parseFromString(variant.toQString());
break;
default:
Mixin::Index<PQ>::setPropertyByIndex(variant, index);
Mixin::Index<PQ>::setPropertyByIndex(index, variant);
break;
}
}
template <class MU, class PQ>
int CPhysicalQuantity<MU, PQ>::comparePropertyByIndex(const PQ &pq, const CPropertyIndex &index) const
int CPhysicalQuantity<MU, PQ>::comparePropertyByIndex(const CPropertyIndex &index, const PQ &pq) const
{
if (index.isMyself()) { return compareImpl(*derived(), pq); }
ColumnIndex i = index.frontCasted<ColumnIndex>();

View File

@@ -208,10 +208,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
int comparePropertyByIndex(const PQ &pq, const CPropertyIndex &index) const;
int comparePropertyByIndex(const CPropertyIndex &index, const PQ &pq) const;
//! \copydoc BlackMisc::Mixin::String::toQString
QString convertToQString(bool i18n = false) const;

View File

@@ -50,7 +50,7 @@ namespace BlackMisc
CPropertyIndexList apply(const BlackMisc::CPropertyIndexVariantMap &indexMap, bool skipEqualValues = false);
//! Set property by index
void setPropertyByIndex(const CVariant &variant, const CPropertyIndex &index);
void setPropertyByIndex(const CPropertyIndex &index, const CVariant &variant);
//! Property by index
CVariant propertyByIndex(const BlackMisc::CPropertyIndex &index) const;
@@ -78,7 +78,7 @@ namespace BlackMisc
template <typename T>
CVariant basePropertyByIndex(const T *base, const CPropertyIndex &index) const { return base->propertyByIndex(index); }
template <typename T>
void baseSetPropertyByIndex(T *base, const CVariant &var, const CPropertyIndex &index) { base->setPropertyByIndex(var, index); }
void baseSetPropertyByIndex(T *base, const CVariant &var, const CPropertyIndex &index) { base->setPropertyByIndex(index, var); }
CVariant basePropertyByIndex(const void *, const CPropertyIndex &index) const
{ qFatal("%s", qPrintable("Property by index not found, index: " + index.toQString())); return {}; }
@@ -216,13 +216,13 @@ namespace BlackMisc
bool equal = derived()->equalsPropertyByIndex(value, index);
if (equal) { continue; }
}
derived()->setPropertyByIndex(value, index);
derived()->setPropertyByIndex(index, value);
changed.push_back(index);
}
return changed;
}
template <class Derived>
void Index<Derived>::setPropertyByIndex(const CVariant &variant, const CPropertyIndex &index)
void Index<Derived>::setPropertyByIndex(const CPropertyIndex &index, const CVariant &variant)
{
if (index.isMyself())
{

View File

@@ -195,7 +195,7 @@ namespace BlackMisc
}
}
void CRgbColor::setPropertyByIndex(const CVariant &variant, const BlackMisc::CPropertyIndex &index)
void CRgbColor::setPropertyByIndex(const CPropertyIndex &index, const CVariant &variant)
{
if (index.isMyself()) { (*this) = variant.to<CRgbColor>(); return; }
ColumnIndex i = index.frontCasted<ColumnIndex>();
@@ -214,12 +214,12 @@ namespace BlackMisc
this->setByString(variant.toQString());
break;
default:
CValueObject::setPropertyByIndex(variant, index);
CValueObject::setPropertyByIndex(index, variant);
break;
}
}
int CRgbColor::comparePropertyByIndex(const CRgbColor &compareValue, const CPropertyIndex &index) const
int CRgbColor::comparePropertyByIndex(const CPropertyIndex &index, const CRgbColor &compareValue) const
{
if (index.isMyself()) { return this->hex().compare(compareValue.hex(), Qt::CaseInsensitive); }
ColumnIndex i = index.frontCasted<ColumnIndex>();

View File

@@ -104,10 +104,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 CRgbColor &compareValue, const CPropertyIndex &index) const;
int comparePropertyByIndex(const CPropertyIndex &index, const CRgbColor &compareValue) const;
private:
int m_r = -1;

View File

@@ -151,11 +151,11 @@ namespace BlackMisc
}
}
void CAircraftModel::setPropertyByIndex(const CVariant &variant, const BlackMisc::CPropertyIndex &index)
void CAircraftModel::setPropertyByIndex(const CPropertyIndex &index, const CVariant &variant)
{
if (index.isMyself()) { (*this) = variant.to<CAircraftModel>(); return; }
if (IOrderable::canHandleIndex(index)) { IOrderable::setPropertyByIndex(variant, index); return; }
if (IDatastoreObjectWithIntegerKey::canHandleIndex(index)) { IDatastoreObjectWithIntegerKey::setPropertyByIndex(variant, index); return; }
if (IOrderable::canHandleIndex(index)) { IOrderable::setPropertyByIndex(index, variant); return; }
if (IDatastoreObjectWithIntegerKey::canHandleIndex(index)) { IDatastoreObjectWithIntegerKey::setPropertyByIndex(index, variant); return; }
ColumnIndex i = index.frontCasted<ColumnIndex>();
switch (i)
@@ -164,25 +164,25 @@ namespace BlackMisc
this->m_modelString = variant.toQString();
break;
case IndexAircraftIcaoCode:
this->m_aircraftIcao.setPropertyByIndex(variant, index.copyFrontRemoved());
this->m_aircraftIcao.setPropertyByIndex(index.copyFrontRemoved(), variant);
break;
case IndexLivery:
this->m_livery.setPropertyByIndex(variant, index.copyFrontRemoved());
this->m_livery.setPropertyByIndex(index.copyFrontRemoved(), variant);
break;
case IndexDistributor:
this->m_distributor.setPropertyByIndex(variant, index.copyFrontRemoved());
this->m_distributor.setPropertyByIndex(index.copyFrontRemoved(), variant);
break;
case IndexDescription:
this->m_description = variant.toQString();
break;
case IndexSimulatorInfo:
this->m_simulator.setPropertyByIndex(variant, index.copyFrontRemoved());
this->m_simulator.setPropertyByIndex(index.copyFrontRemoved(), variant);
break;
case IndexName:
this->m_name = variant.toQString();
break;
case IndexCallsign:
this->m_callsign.setPropertyByIndex(variant, index.copyFrontRemoved());
this->m_callsign.setPropertyByIndex(index.copyFrontRemoved(), variant);
break;
case IndexFileName:
this->m_fileName = variant.toQString();
@@ -204,15 +204,15 @@ namespace BlackMisc
}
break;
default:
CValueObject::setPropertyByIndex(variant, index);
CValueObject::setPropertyByIndex(index, variant);
break;
}
}
int CAircraftModel::comparePropertyByIndex(const CAircraftModel &compareValue, const CPropertyIndex &index) const
int CAircraftModel::comparePropertyByIndex(const CPropertyIndex &index, const CAircraftModel &compareValue) const
{
if (IDatastoreObjectWithIntegerKey::canHandleIndex(index)) { return IDatastoreObjectWithIntegerKey::comparePropertyByIndex(compareValue, index);}
if (IOrderable::canHandleIndex(index)) { return IOrderable::comparePropertyByIndex(compareValue, index);}
if (IDatastoreObjectWithIntegerKey::canHandleIndex(index)) { return IDatastoreObjectWithIntegerKey::comparePropertyByIndex(index, compareValue);}
if (IOrderable::canHandleIndex(index)) { return IOrderable::comparePropertyByIndex(index, compareValue);}
if (index.isMyself()) { return this->m_modelString.compare(compareValue.getModelString(), Qt::CaseInsensitive); }
ColumnIndex i = index.frontCasted<ColumnIndex>();
switch (i)
@@ -220,20 +220,20 @@ namespace BlackMisc
case IndexModelString:
return this->m_modelString.compare(compareValue.getModelString(), Qt::CaseInsensitive);
case IndexAircraftIcaoCode:
return this->m_aircraftIcao.comparePropertyByIndex(compareValue.getAircraftIcaoCode(), index.copyFrontRemoved());
return this->m_aircraftIcao.comparePropertyByIndex(index.copyFrontRemoved(), compareValue.getAircraftIcaoCode());
case IndexLivery:
return this->m_livery.comparePropertyByIndex(compareValue.getLivery(), index.copyFrontRemoved());
return this->m_livery.comparePropertyByIndex(index.copyFrontRemoved(), compareValue.getLivery());
case IndexDistributor:
return this->m_distributor.comparePropertyByIndex(compareValue.getDistributor(), index.copyFrontRemoved());
return this->m_distributor.comparePropertyByIndex(index.copyFrontRemoved(), compareValue.getDistributor());
case IndexDescription:
return this->m_description.compare(compareValue.getDescription(), Qt::CaseInsensitive);
case IndexSimulatorInfoAsString:
case IndexSimulatorInfo:
return this->m_simulator.comparePropertyByIndex(compareValue.getSimulator(), index.copyFrontRemoved());
return this->m_simulator.comparePropertyByIndex(index.copyFrontRemoved(), compareValue.getSimulator());
case IndexName:
return this->m_name.compare(compareValue.getName(), Qt::CaseInsensitive);
case IndexCallsign:
return this->m_callsign.comparePropertyByIndex(compareValue.getCallsign(), index.copyFrontRemoved());
return this->m_callsign.comparePropertyByIndex(index.copyFrontRemoved(), compareValue.getCallsign());
case IndexFileName:
return this->m_fileName.compare(compareValue.getFileName(), Qt::CaseInsensitive);
case IndexIconPath:

View File

@@ -102,10 +102,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 by index
int comparePropertyByIndex(const CAircraftModel &compareValue, const CPropertyIndex &index) const;
int comparePropertyByIndex(const CPropertyIndex &index, const CAircraftModel &compareValue) const;
//! \copydoc BlackMisc::Mixin::String::toQString
QString convertToQString(bool i18n = false) const;

View File

@@ -114,10 +114,10 @@ namespace BlackMisc
return CValueObject::propertyByIndex(index);
}
void CAirspaceAircraftSnapshot::setPropertyByIndex(const CVariant &variant, const CPropertyIndex &index)
void CAirspaceAircraftSnapshot::setPropertyByIndex(const CPropertyIndex &index, const CVariant &variant)
{
if (index.isMyself()) { (*this) = variant.to<CAirspaceAircraftSnapshot>(); return; }
CValueObject::setPropertyByIndex(variant, index);
CValueObject::setPropertyByIndex(index, variant);
}
QString CAirspaceAircraftSnapshot::convertToQString(bool i18n) const

View File

@@ -79,7 +79,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;

View File

@@ -64,11 +64,11 @@ namespace BlackMisc
}
}
void CDistributor::setPropertyByIndex(const CVariant &variant, const CPropertyIndex &index)
void CDistributor::setPropertyByIndex(const CPropertyIndex &index, const CVariant &variant)
{
if (index.isMyself()) { (*this) = variant.to<CDistributor>(); return; }
if (IDatastoreObjectWithStringKey::canHandleIndex(index)) { IDatastoreObjectWithStringKey::setPropertyByIndex(variant, index); return; }
if (IOrderable::canHandleIndex(index)) { IOrderable::setPropertyByIndex(variant, index); return; }
if (IDatastoreObjectWithStringKey::canHandleIndex(index)) { IDatastoreObjectWithStringKey::setPropertyByIndex(index, variant); return; }
if (IOrderable::canHandleIndex(index)) { IOrderable::setPropertyByIndex(index, variant); return; }
ColumnIndex i = index.frontCasted<ColumnIndex>();
switch (i)
@@ -83,25 +83,25 @@ namespace BlackMisc
this->m_description = variant.value<QString>();
break;
case IndexSimulator:
this->m_simulator.setPropertyByIndex(variant, index.copyFrontRemoved());
this->m_simulator.setPropertyByIndex(index.copyFrontRemoved(), variant);
break;
default:
CValueObject::setPropertyByIndex(variant, index);
CValueObject::setPropertyByIndex(index, variant);
break;
}
}
int CDistributor::comparePropertyByIndex(const CDistributor &compareValue, const CPropertyIndex &index) const
int CDistributor::comparePropertyByIndex(const CPropertyIndex &index, const CDistributor &compareValue) const
{
if (IDatastoreObjectWithStringKey::canHandleIndex(index)) { return IDatastoreObjectWithStringKey::comparePropertyByIndex(compareValue, index); }
if (IOrderable::canHandleIndex(index)) { return IOrderable::comparePropertyByIndex(compareValue, index); }
if (IDatastoreObjectWithStringKey::canHandleIndex(index)) { return IDatastoreObjectWithStringKey::comparePropertyByIndex(index, compareValue); }
if (IOrderable::canHandleIndex(index)) { return IOrderable::comparePropertyByIndex(index, compareValue); }
ColumnIndex i = index.frontCasted<ColumnIndex>();
switch (i)
{
case IndexAlias1: return this->m_alias1.compare(compareValue.m_alias1, Qt::CaseInsensitive);
case IndexAlias2: return this->m_alias2.compare(compareValue.m_alias2, Qt::CaseInsensitive);
case IndexDescription: return this->m_description.compare(compareValue.getDescription(), Qt::CaseInsensitive);
case IndexSimulator: return this->m_simulator.comparePropertyByIndex(compareValue.m_simulator, index.copyFrontRemoved());
case IndexSimulator: return this->m_simulator.comparePropertyByIndex(index.copyFrontRemoved(), compareValue.m_simulator);
default:
break;
}

View File

@@ -95,10 +95,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 CDistributor &compareValue, const CPropertyIndex &index) const;
int comparePropertyByIndex(const CPropertyIndex &index, const CDistributor &compareValue) const;
//! \copydoc BlackMisc::Mixin::String::toQString
QString convertToQString(bool i18n = false) const;

View File

@@ -185,10 +185,10 @@ namespace BlackMisc
}
}
void CAircraftCfgEntries::setPropertyByIndex(const CVariant &variant, const BlackMisc::CPropertyIndex &index)
void CAircraftCfgEntries::setPropertyByIndex(const CPropertyIndex &index, const CVariant &variant)
{
if (index.isMyself()) { (*this) = variant.to<CAircraftCfgEntries>(); 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)
{
@@ -207,7 +207,7 @@ namespace BlackMisc
case IndexCreatedBy: this->setCreatedBy(variant.toQString()); break;
case IndexRotorcraft: this->setRotorcraft(variant.toBool()); break;
default:
CValueObject::setPropertyByIndex(variant, index);
CValueObject::setPropertyByIndex(index, variant);
break;
}
}

View File

@@ -165,7 +165,7 @@ namespace BlackMisc
BlackMisc::CVariant propertyByIndex(const BlackMisc::CPropertyIndex &index) const;
//! \copydoc BlackMisc::Mixin::Index::setPropertyByIndex
void setPropertyByIndex(const BlackMisc::CVariant &variant, const BlackMisc::CPropertyIndex &index);
void setPropertyByIndex(const BlackMisc::CPropertyIndex &index, const BlackMisc::CVariant &variant);
//! \copydoc BlackMisc::Mixin::String::toQString
QString convertToQString(bool i18n = false) const;

View File

@@ -64,10 +64,10 @@ namespace BlackMisc
}
}
void CVPilotModelRule::setPropertyByIndex(const CVariant &variant, const CPropertyIndex &index)
void CVPilotModelRule::setPropertyByIndex(const CPropertyIndex &index, const CVariant &variant)
{
if (index.isMyself()) { (*this) = variant.to<CVPilotModelRule>(); 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)
{
@@ -76,7 +76,7 @@ namespace BlackMisc
case IndexTypeCode: this->setTypeCode(variant.value<QString>()); break;
case IndexCallsignPrefix: this->setCallsignPrefix(variant.value<QString>()); break;
default:
CValueObject::setPropertyByIndex(variant, index);
CValueObject::setPropertyByIndex(index, variant);
break;
}
}

View File

@@ -77,7 +77,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;

View File

@@ -310,38 +310,38 @@ namespace BlackMisc
}
}
void CSimulatedAircraft::setPropertyByIndex(const CVariant &variant, const BlackMisc::CPropertyIndex &index)
void CSimulatedAircraft::setPropertyByIndex(const CPropertyIndex &index, const CVariant &variant)
{
if (index.isMyself()) { (*this) = variant.to<CSimulatedAircraft>(); return; }
ColumnIndex i = index.frontCasted<ColumnIndex>();
switch (i)
{
case IndexCallsign:
this->m_callsign.setPropertyByIndex(variant, index.copyFrontRemoved());
this->m_callsign.setPropertyByIndex(index.copyFrontRemoved(), variant);
break;
case IndexPilot:
this->m_pilot.setPropertyByIndex(variant, index.copyFrontRemoved());
this->m_pilot.setPropertyByIndex(index.copyFrontRemoved(), variant);
break;
case IndexDistanceToOwnAircraft:
this->m_distanceToOwnAircraft.setPropertyByIndex(variant, index.copyFrontRemoved());
this->m_distanceToOwnAircraft.setPropertyByIndex(index.copyFrontRemoved(), variant);
break;
case IndexCom1System:
this->m_com1system.setPropertyByIndex(variant, index.copyFrontRemoved());
this->m_com1system.setPropertyByIndex(index.copyFrontRemoved(), variant);
break;
case IndexCom2System:
this->m_com2system.setPropertyByIndex(variant, index.copyFrontRemoved());
this->m_com2system.setPropertyByIndex(index.copyFrontRemoved(), variant);
break;
case IndexTransponder:
this->m_transponder.setPropertyByIndex(variant, index.copyFrontRemoved());
this->m_transponder.setPropertyByIndex(index.copyFrontRemoved(), variant);
break;
case IndexSituation:
this->m_situation.setPropertyByIndex(variant, index.copyFrontRemoved());
this->m_situation.setPropertyByIndex(index.copyFrontRemoved(), variant);
break;
case IndexParts:
this->m_parts.setPropertyByIndex(variant, index.copyFrontRemoved());
this->m_parts.setPropertyByIndex(index.copyFrontRemoved(), variant);
break;
case IndexModel:
this->m_model.setPropertyByIndex(variant, index.copyFrontRemoved());
this->m_model.setPropertyByIndex(index.copyFrontRemoved(), variant);
this->setModel(this->m_model); // sync some values
break;
case IndexEnabled:
@@ -360,36 +360,36 @@ namespace BlackMisc
Q_ASSERT_X(false, Q_FUNC_INFO, "Unsupported");
break;
default:
CValueObject::setPropertyByIndex(variant, index);
CValueObject::setPropertyByIndex(index, variant);
break;
}
}
int CSimulatedAircraft::comparePropertyByIndex(const CSimulatedAircraft &compareValue, const CPropertyIndex &index) const
int CSimulatedAircraft::comparePropertyByIndex(const CPropertyIndex &index, const CSimulatedAircraft &compareValue) const
{
if (index.isMyself()) { return this->m_callsign.comparePropertyByIndex(compareValue.getCallsign(), index.copyFrontRemoved()); }
if (index.isMyself()) { return this->m_callsign.comparePropertyByIndex(index.copyFrontRemoved(), compareValue.getCallsign()); }
ColumnIndex i = index.frontCasted<ColumnIndex>();
switch (i)
{
case IndexCallsign:
return this->m_callsign.comparePropertyByIndex(compareValue.getCallsign(), index.copyFrontRemoved());
return this->m_callsign.comparePropertyByIndex(index.copyFrontRemoved(), compareValue.getCallsign());
case IndexPilot:
return this->m_pilot.comparePropertyByIndex(compareValue.getPilot(), index.copyFrontRemoved());
return this->m_pilot.comparePropertyByIndex(index.copyFrontRemoved(), compareValue.getPilot());
case IndexSituation:
case IndexDistanceToOwnAircraft:
return this->m_distanceToOwnAircraft.comparePropertyByIndex(compareValue.getDistanceToOwnAircraft(), index.copyFrontRemoved());
return this->m_distanceToOwnAircraft.comparePropertyByIndex(index.copyFrontRemoved(), compareValue.getDistanceToOwnAircraft());
case IndexCom1System:
return m_com1system.getFrequencyActive().comparePropertyByIndex(compareValue.getCom1System().getFrequencyActive(), index.copyFrontRemoved());
return m_com1system.getFrequencyActive().comparePropertyByIndex(index.copyFrontRemoved(), compareValue.getCom1System().getFrequencyActive());
case IndexCom2System:
return m_com2system.getFrequencyActive().comparePropertyByIndex(compareValue.getCom2System().getFrequencyActive(), index.copyFrontRemoved());
return m_com2system.getFrequencyActive().comparePropertyByIndex(index.copyFrontRemoved(), compareValue.getCom2System().getFrequencyActive());
case IndexTransponder:
return Compare::compare(m_transponder.getTransponderCode(), compareValue.getTransponder().getTransponderCode());
case IndexLivery:
return this->getLivery().comparePropertyByIndex(compareValue.getLivery(), index.copyFrontRemoved());
return this->getLivery().comparePropertyByIndex(index.copyFrontRemoved(), compareValue.getLivery());
case IndexParts:
return this->m_parts.comparePropertyByIndex(compareValue.getParts(), index.copyFrontRemoved());
return this->m_parts.comparePropertyByIndex(index.copyFrontRemoved(), compareValue.getParts());
case IndexModel:
return m_model.comparePropertyByIndex(compareValue.getModel(), index.copyFrontRemoved());
return m_model.comparePropertyByIndex(index.copyFrontRemoved(), compareValue.getModel());
case IndexEnabled:
return Compare::compare(this->m_enabled, compareValue.isEnabled());
case IndexRendered:

View File

@@ -305,10 +305,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 CSimulatedAircraft &compareValue, const CPropertyIndex &index) const;
int comparePropertyByIndex(const CPropertyIndex &index, const CSimulatedAircraft &compareValue) const;
//! Get model
const BlackMisc::Simulation::CAircraftModel &getModel() const { return m_model; }

View File

@@ -117,7 +117,7 @@ namespace BlackMisc
return (this->m_simulator & otherInfo.m_simulator) > 0;
}
int CSimulatorInfo::comparePropertyByIndex(const CSimulatorInfo &compareValue, const CPropertyIndex &index) const
int CSimulatorInfo::comparePropertyByIndex(const CPropertyIndex &index, const CSimulatorInfo &compareValue) const
{
Q_UNUSED(index);
return Compare::compare(this->m_simulator, compareValue.m_simulator);

View File

@@ -126,7 +126,7 @@ namespace BlackMisc
void setAllSimulators() { setSimulator(All); }
//! Compare for index
int comparePropertyByIndex(const CSimulatorInfo &compareValue, const CPropertyIndex &index) const;
int comparePropertyByIndex(const CPropertyIndex &index, const CSimulatorInfo &compareValue) const;
//! \copydoc BlackMisc::Mixin::String::toQString
QString convertToQString(bool i18n = false) const;

View File

@@ -68,7 +68,7 @@ namespace BlackMisc
}
}
void CSimulatorSetup::setPropertyByIndex(const CVariant &variant, const BlackMisc::CPropertyIndex &index)
void CSimulatorSetup::setPropertyByIndex(const CPropertyIndex &index, const CVariant &variant)
{
if (index.isMyself()) { (*this) = variant.to<CSimulatorSetup>(); return; }
ColumnIndex i = index.frontCasted<ColumnIndex>();
@@ -78,7 +78,7 @@ namespace BlackMisc
this->m_data = variant.to<CNameVariantPairList>();
break;
default:
CValueObject::setPropertyByIndex(variant, index);
CValueObject::setPropertyByIndex(index, variant);
break;
}
}

View File

@@ -63,7 +63,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);
//! Register metadata
void static registerMetadata();

View File

@@ -37,10 +37,10 @@ namespace BlackMisc
CValueObject::propertyByIndex(index);
}
void CNavDataReference::setPropertyByIndex(const CVariant &variant, const BlackMisc::CPropertyIndex &index)
void CNavDataReference::setPropertyByIndex(const CPropertyIndex &index, const CVariant &variant)
{
if (index.isMyself()) { (*this) = variant.to<CNavDataReference>(); return; }
CValueObject::setPropertyByIndex(variant, index);
CValueObject::setPropertyByIndex(index, variant);
}
QString CNavDataReference::convertToQString(bool i18n) const

View File

@@ -50,7 +50,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;

View File

@@ -405,10 +405,10 @@ namespace BlackMisc
}
}
void CStatusMessage::setPropertyByIndex(const CVariant &variant, const BlackMisc::CPropertyIndex &index)
void CStatusMessage::setPropertyByIndex(const CPropertyIndex &index, const CVariant &variant)
{
if (index.isMyself()) { (*this) = variant.to<CStatusMessage>(); 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)
{
@@ -423,15 +423,15 @@ namespace BlackMisc
this->m_categories = variant.value<CLogCategoryList>();
break;
default:
CValueObject::setPropertyByIndex(variant, index);
CValueObject::setPropertyByIndex(index, variant);
break;
}
}
int CStatusMessage::comparePropertyByIndex(const CStatusMessage &compareValue, const CPropertyIndex &index) const
int CStatusMessage::comparePropertyByIndex(const CPropertyIndex &index, const CStatusMessage &compareValue) const
{
if (index.isMyself()) { return Compare::compare(this->getSeverity(), compareValue.getSeverity()); }
if (ITimestampBased::canHandleIndex(index)) { return ITimestampBased::comparePropertyByIndex(compareValue, index); }
if (ITimestampBased::canHandleIndex(index)) { return ITimestampBased::comparePropertyByIndex(index, compareValue); }
ColumnIndex i = index.frontCasted<ColumnIndex>();
switch (i)
{

View File

@@ -286,10 +286,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 CStatusMessage &compareValue, const CPropertyIndex &index) const;
int comparePropertyByIndex(const CPropertyIndex &index, const CStatusMessage &compareValue) const;
//! To HTML
QString toHtml() const;

View File

@@ -47,15 +47,15 @@ namespace BlackMisc
CAtcStation station;
if (byPropertyIndex)
{
station.setPropertyByIndex(CVariant::from(CCallsign(cs)), CAtcStation::IndexCallsign);
station.setPropertyByIndex(CVariant::from(user), CAtcStation::IndexController);
station.setPropertyByIndex(CVariant::from(CFrequency(f, CFrequencyUnit::MHz())), CAtcStation::IndexFrequency);
station.setPropertyByIndex(CVariant::from(CLength(50, CLengthUnit::km())), CAtcStation::IndexRange);
station.setPropertyByIndex(CVariant::from(geoPos), CAtcStation::IndexPosition);
station.setPropertyByIndex(CVariant::from(false), CAtcStation::IndexIsOnline);
station.setPropertyByIndex(CVariant::from(dtFrom), CAtcStation::IndexBookedFrom);
station.setPropertyByIndex(CVariant::from(dtUntil), CAtcStation::IndexBookedUntil);
station.setPropertyByIndex(CVariant::from(CLength(index + 1, CLengthUnit::NM())), CAtcStation::IndexDistanceToOwnAircraft);
station.setPropertyByIndex(CAtcStation::IndexCallsign, CVariant::from(CCallsign(cs)));
station.setPropertyByIndex(CAtcStation::IndexController, CVariant::from(user));
station.setPropertyByIndex(CAtcStation::IndexFrequency, CVariant::from(CFrequency(f, CFrequencyUnit::MHz())));
station.setPropertyByIndex(CAtcStation::IndexRange, CVariant::from(CLength(50, CLengthUnit::km())));
station.setPropertyByIndex(CAtcStation::IndexPosition, CVariant::from(geoPos));
station.setPropertyByIndex(CAtcStation::IndexIsOnline, CVariant::from(false));
station.setPropertyByIndex(CAtcStation::IndexBookedFrom, CVariant::from(dtFrom));
station.setPropertyByIndex(CAtcStation::IndexBookedUntil, CVariant::from(dtUntil));
station.setPropertyByIndex(CAtcStation::IndexDistanceToOwnAircraft, CVariant::from(CLength(index + 1, CLengthUnit::NM())));
}
else
{
@@ -71,7 +71,7 @@ namespace BlackMisc
void CTesting::readStations(const CAtcStationList &stations, bool byPropertyIndex)
{
foreach(const CAtcStation station, stations)
foreach (const CAtcStation station, stations)
{
readStation(station, byPropertyIndex);
}

View File

@@ -174,7 +174,7 @@ namespace BlackMisc
return CVariant::fromValue(m);
}
void ITimestampBased::setPropertyByIndex(const CVariant &variant, const CPropertyIndex &index)
void ITimestampBased::setPropertyByIndex(const CPropertyIndex &index, const CVariant &variant)
{
if (!index.isEmpty())
{
@@ -204,7 +204,7 @@ namespace BlackMisc
Q_ASSERT_X(false, Q_FUNC_INFO, m.toLocal8Bit().constData());
}
int ITimestampBased::comparePropertyByIndex(const ITimestampBased &compareValue, const CPropertyIndex &index) const
int ITimestampBased::comparePropertyByIndex(const CPropertyIndex &index, const ITimestampBased &compareValue) const
{
Q_UNUSED(index);
return Compare::compare(this->m_timestampMSecsSinceEpoch, compareValue.m_timestampMSecsSinceEpoch);

View File

@@ -108,10 +108,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 ITimestampBased &compareValue, const CPropertyIndex &index) const;
int comparePropertyByIndex(const CPropertyIndex &index, const ITimestampBased &compareValue) const;
qint64 m_timestampMSecsSinceEpoch; //!< timestamp value
};

View File

@@ -268,7 +268,7 @@ namespace BlackMisc
}
}
void CVariant::setPropertyByIndex(const CVariant &variant, const CPropertyIndex &index)
void CVariant::setPropertyByIndex(const CPropertyIndex &index, const CVariant &variant)
{
auto *meta = getValueObjectMetaInfo();
Q_ASSERT(meta);

View File

@@ -281,7 +281,7 @@ namespace BlackMisc
friend int compare(const CVariant &a, const CVariant &b) { return compareImpl(a, b); }
//! \copydoc BlackMisc::Mixin::Index::setPropertyByIndex
void setPropertyByIndex(const CVariant &variant, const CPropertyIndex &index);
void setPropertyByIndex(const CPropertyIndex &index, const CVariant &variant);
//! \copydoc BlackMisc::Mixin::Index::propertyByIndex
CVariant propertyByIndex(const BlackMisc::CPropertyIndex &index) const;

View File

@@ -121,7 +121,7 @@ namespace BlackMisc
static int compareImpl(const T &lhs, const T&, ...) { throw CVariantException(lhs, "compare"); }
template <typename T>
static void setPropertyByIndex(T &object, const CVariant &variant, const CPropertyIndex &index, decltype(static_cast<void>(object.setPropertyByIndex(variant, index)), 0)) { object.setPropertyByIndex(variant, index); }
static void setPropertyByIndex(T &object, const CVariant &variant, const CPropertyIndex &index, decltype(static_cast<void>(object.setPropertyByIndex(index, variant)), 0)) { object.setPropertyByIndex(index, variant); }
template <typename T>
static void setPropertyByIndex(T &object, const CVariant &, const CPropertyIndex &, ...) { throw CVariantException(object, "setPropertyByIndex"); }

Some files were not shown because too many files have changed in this diff Show More