From 0f5d2a29a8d993bcc84f614a1ff65685ee98f0d1 Mon Sep 17 00:00:00 2001 From: Klaus Basan Date: Mon, 9 May 2016 23:15:39 +0200 Subject: [PATCH] refs #655, Change signature (order) of setProperty/compareProperty --- src/blackcore/data/globalsetup.cpp | 10 ++--- src/blackcore/data/globalsetup.h | 2 +- src/blackcore/data/updateinfo.cpp | 6 +-- src/blackcore/data/updateinfo.h | 2 +- src/blackcore/data/vatsimsetup.cpp | 6 +-- src/blackcore/data/vatsimsetup.h | 2 +- src/blackgui/models/listmodelbase.cpp | 2 +- src/blackgui/models/listmodelbase.h | 2 +- src/blackgui/views/viewbase.cpp | 8 ++-- src/blackmisc/audio/voiceroom.cpp | 4 +- src/blackmisc/audio/voiceroom.h | 2 +- src/blackmisc/aviation/adfsystem.h | 1 - src/blackmisc/aviation/aircrafticaocode.cpp | 10 ++--- src/blackmisc/aviation/aircrafticaocode.h | 4 +- src/blackmisc/aviation/aircraftlights.cpp | 4 +- src/blackmisc/aviation/aircraftlights.h | 2 +- src/blackmisc/aviation/aircraftparts.cpp | 14 +++---- src/blackmisc/aviation/aircraftparts.h | 4 +- src/blackmisc/aviation/aircraftsituation.cpp | 18 ++++---- src/blackmisc/aviation/aircraftsituation.h | 2 +- src/blackmisc/aviation/airlineicaocode.cpp | 15 ++++--- src/blackmisc/aviation/airlineicaocode.h | 4 +- src/blackmisc/aviation/airport.cpp | 22 +++++----- src/blackmisc/aviation/airport.h | 4 +- src/blackmisc/aviation/airporticaocode.cpp | 2 +- src/blackmisc/aviation/airporticaocode.h | 2 +- src/blackmisc/aviation/atcstation.cpp | 22 +++++----- src/blackmisc/aviation/atcstation.h | 2 +- src/blackmisc/aviation/callsign.cpp | 6 +-- src/blackmisc/aviation/callsign.h | 4 +- src/blackmisc/aviation/livery.cpp | 22 +++++----- src/blackmisc/aviation/livery.h | 4 +- src/blackmisc/aviation/modulator.cpp | 8 ++-- src/blackmisc/aviation/modulator.h | 2 +- src/blackmisc/aviation/track.cpp | 2 - src/blackmisc/aviation/transponder.cpp | 2 +- src/blackmisc/aviation/transponder.h | 2 +- src/blackmisc/country.cpp | 12 +++--- src/blackmisc/country.h | 6 +-- src/blackmisc/datastore.cpp | 22 +++++----- src/blackmisc/datastore.h | 8 ++-- src/blackmisc/geo/coordinategeodetic.cpp | 6 +-- src/blackmisc/geo/coordinategeodetic.h | 2 +- src/blackmisc/identifier.cpp | 4 +- src/blackmisc/identifier.h | 2 +- src/blackmisc/input/actionhotkey.cpp | 4 +- src/blackmisc/input/actionhotkey.h | 2 +- src/blackmisc/input/joystickbutton.cpp | 2 +- src/blackmisc/input/joystickbutton.h | 2 +- src/blackmisc/input/keyboardkey.cpp | 2 +- src/blackmisc/input/keyboardkey.h | 2 +- src/blackmisc/namevariantpair.cpp | 5 +-- src/blackmisc/namevariantpair.h | 2 +- src/blackmisc/network/authenticateduser.cpp | 6 +-- src/blackmisc/network/authenticateduser.h | 2 +- src/blackmisc/network/client.cpp | 10 ++--- src/blackmisc/network/client.h | 2 +- src/blackmisc/network/role.cpp | 6 +-- src/blackmisc/network/role.h | 2 +- src/blackmisc/network/server.cpp | 6 +-- src/blackmisc/network/server.h | 2 +- src/blackmisc/network/textmessage.cpp | 10 ++--- src/blackmisc/network/textmessage.h | 2 +- src/blackmisc/network/url.cpp | 4 +- src/blackmisc/network/url.h | 2 +- src/blackmisc/network/user.cpp | 14 +++---- src/blackmisc/network/user.h | 4 +- src/blackmisc/orderable.cpp | 4 +- src/blackmisc/orderable.h | 4 +- src/blackmisc/pq/physicalquantity.cpp | 6 +-- src/blackmisc/pq/physicalquantity.h | 4 +- src/blackmisc/propertyindexvariantmap.h | 8 ++-- src/blackmisc/rgbcolor.cpp | 6 +-- src/blackmisc/rgbcolor.h | 4 +- src/blackmisc/simulation/aircraftmodel.cpp | 34 +++++++-------- src/blackmisc/simulation/aircraftmodel.h | 4 +- .../simulation/airspaceaircraftsnapshot.cpp | 4 +- .../simulation/airspaceaircraftsnapshot.h | 2 +- src/blackmisc/simulation/distributor.cpp | 18 ++++---- src/blackmisc/simulation/distributor.h | 4 +- .../fscommon/aircraftcfgentries.cpp | 6 +-- .../simulation/fscommon/aircraftcfgentries.h | 2 +- .../simulation/fscommon/vpilotmodelrule.cpp | 6 +-- .../simulation/fscommon/vpilotmodelrule.h | 2 +- .../simulation/simulatedaircraft.cpp | 42 +++++++++---------- src/blackmisc/simulation/simulatedaircraft.h | 4 +- src/blackmisc/simulation/simulatorinfo.cpp | 2 +- src/blackmisc/simulation/simulatorinfo.h | 2 +- src/blackmisc/simulation/simulatorsetup.cpp | 4 +- src/blackmisc/simulation/simulatorsetup.h | 2 +- .../simulation/xplane/navdatareference.cpp | 4 +- .../simulation/xplane/navdatareference.h | 2 +- src/blackmisc/statusmessage.cpp | 10 ++--- src/blackmisc/statusmessage.h | 4 +- src/blackmisc/testing.cpp | 20 ++++----- src/blackmisc/timestampbased.cpp | 4 +- src/blackmisc/timestampbased.h | 4 +- src/blackmisc/variant.cpp | 2 +- src/blackmisc/variant.h | 2 +- src/blackmisc/variantprivate.h | 2 +- src/blackmisc/weather/cloudlayer.cpp | 4 +- src/blackmisc/weather/cloudlayer.h | 2 +- src/blackmisc/weather/gridpoint.cpp | 4 +- src/blackmisc/weather/gridpoint.h | 2 +- src/blackmisc/weather/presentweather.cpp | 4 +- src/blackmisc/weather/presentweather.h | 2 +- src/blackmisc/weather/temperaturelayer.cpp | 4 +- src/blackmisc/weather/temperaturelayer.h | 2 +- src/blackmisc/weather/visibilitylayer.cpp | 4 +- src/blackmisc/weather/visibilitylayer.h | 2 +- src/blackmisc/weather/windlayer.cpp | 4 +- src/blackmisc/weather/windlayer.h | 2 +- tests/blackmisc/testvalueobject.cpp | 4 +- tests/blackmisc/testvalueobject.h | 2 +- 114 files changed, 324 insertions(+), 331 deletions(-) diff --git a/src/blackcore/data/globalsetup.cpp b/src/blackcore/data/globalsetup.cpp index bdf7f9bd5..3f94ec16d 100644 --- a/src/blackcore/data/globalsetup.cpp +++ b/src/blackcore/data/globalsetup.cpp @@ -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(); 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(); 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(); @@ -272,7 +272,7 @@ namespace BlackCore this->m_wasLoaded = variant.toBool(); break; default: - CValueObject::setPropertyByIndex(variant, index); + CValueObject::setPropertyByIndex(index, variant); break; } } diff --git a/src/blackcore/data/globalsetup.h b/src/blackcore/data/globalsetup.h index 5c29f8e8c..30f3ba249 100644 --- a/src/blackcore/data/globalsetup.h +++ b/src/blackcore/data/globalsetup.h @@ -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(); diff --git a/src/blackcore/data/updateinfo.cpp b/src/blackcore/data/updateinfo.cpp index daa727fce..cff0a6357 100644 --- a/src/blackcore/data/updateinfo.cpp +++ b/src/blackcore/data/updateinfo.cpp @@ -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(); 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; } } diff --git a/src/blackcore/data/updateinfo.h b/src/blackcore/data/updateinfo.h index 6424998f5..6dac0fcf8 100644 --- a/src/blackcore/data/updateinfo.h +++ b/src/blackcore/data/updateinfo.h @@ -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 diff --git a/src/blackcore/data/vatsimsetup.cpp b/src/blackcore/data/vatsimsetup.cpp index 611b703e8..e7c1414b9 100644 --- a/src/blackcore/data/vatsimsetup.cpp +++ b/src/blackcore/data/vatsimsetup.cpp @@ -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(); 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(); break; default: - CValueObject::setPropertyByIndex(variant, index); + CValueObject::setPropertyByIndex(index, variant); break; } } diff --git a/src/blackcore/data/vatsimsetup.h b/src/blackcore/data/vatsimsetup.h index 5082349a2..817cef8bd 100644 --- a/src/blackcore/data/vatsimsetup.h +++ b/src/blackcore/data/vatsimsetup.h @@ -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 diff --git a/src/blackgui/models/listmodelbase.cpp b/src/blackgui/models/listmodelbase.cpp index c36b96ea0..f99b490a8 100644 --- a/src/blackgui/models/listmodelbase.cpp +++ b/src/blackgui/models/listmodelbase.cpp @@ -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) { diff --git a/src/blackgui/models/listmodelbase.h b/src/blackgui/models/listmodelbase.h index 252eaf215..e7b902da1 100644 --- a/src/blackgui/models/listmodelbase.h +++ b/src/blackgui/models/listmodelbase.h @@ -298,7 +298,7 @@ namespace BlackGui template 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); } diff --git a/src/blackgui/views/viewbase.cpp b/src/blackgui/views/viewbase.cpp index cc4cc05bf..0059374ec 100644 --- a/src/blackgui/views/viewbase.cpp +++ b/src/blackgui/views/viewbase.cpp @@ -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 diff --git a/src/blackmisc/audio/voiceroom.cpp b/src/blackmisc/audio/voiceroom.cpp index 402b19533..2dd1359b3 100644 --- a/src/blackmisc/audio/voiceroom.cpp +++ b/src/blackmisc/audio/voiceroom.cpp @@ -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(); return; } ColumnIndex i = index.frontCasted(); @@ -68,7 +68,7 @@ namespace BlackMisc this->setVoiceRoomUrl(variant.value()); break; default: - CValueObject::setPropertyByIndex(variant, index); + CValueObject::setPropertyByIndex(index, variant); break; } } diff --git a/src/blackmisc/audio/voiceroom.h b/src/blackmisc/audio/voiceroom.h index b6a710718..a13dec354 100644 --- a/src/blackmisc/audio/voiceroom.h +++ b/src/blackmisc/audio/voiceroom.h @@ -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; } diff --git a/src/blackmisc/aviation/adfsystem.h b/src/blackmisc/aviation/adfsystem.h index 213fa931e..30ff2d7ee 100644 --- a/src/blackmisc/aviation/adfsystem.h +++ b/src/blackmisc/aviation/adfsystem.h @@ -84,7 +84,6 @@ namespace BlackMisc this->isValidFrequency(this->getFrequencyStandby()); } }; - } } diff --git a/src/blackmisc/aviation/aircrafticaocode.cpp b/src/blackmisc/aviation/aircrafticaocode.cpp index d32c9ce2f..fa91d8265 100644 --- a/src/blackmisc/aviation/aircrafticaocode.cpp +++ b/src/blackmisc/aviation/aircrafticaocode.cpp @@ -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(); return; } - if (IDatastoreObjectWithIntegerKey::canHandleIndex(index)) { IDatastoreObjectWithIntegerKey::setPropertyByIndex(variant, index); return; } + if (IDatastoreObjectWithIntegerKey::canHandleIndex(index)) { IDatastoreObjectWithIntegerKey::setPropertyByIndex(index, variant); return; } ColumnIndex i = index.frontCasted(); 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(); switch (i) { diff --git a/src/blackmisc/aviation/aircrafticaocode.h b/src/blackmisc/aviation/aircrafticaocode.h index 60b3d20e9..421111937 100644 --- a/src/blackmisc/aviation/aircrafticaocode.h +++ b/src/blackmisc/aviation/aircrafticaocode.h @@ -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; diff --git a/src/blackmisc/aviation/aircraftlights.cpp b/src/blackmisc/aviation/aircraftlights.cpp index 951a436c4..9fee7b5c4 100644 --- a/src/blackmisc/aviation/aircraftlights.cpp +++ b/src/blackmisc/aviation/aircraftlights.cpp @@ -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(); return; } ColumnIndex i = index.frontCasted(); @@ -99,7 +99,7 @@ namespace BlackMisc this->m_taxiOn = variant.toBool(); break; default: - CValueObject::setPropertyByIndex(variant, index); + CValueObject::setPropertyByIndex(index, variant); break; } } diff --git a/src/blackmisc/aviation/aircraftlights.h b/src/blackmisc/aviation/aircraftlights.h index 7e4e41a83..522c065ab 100644 --- a/src/blackmisc/aviation/aircraftlights.h +++ b/src/blackmisc/aviation/aircraftlights.h @@ -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; } diff --git a/src/blackmisc/aviation/aircraftparts.cpp b/src/blackmisc/aviation/aircraftparts.cpp index 484731c65..5b8b44212 100644 --- a/src/blackmisc/aviation/aircraftparts.cpp +++ b/src/blackmisc/aviation/aircraftparts.cpp @@ -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(); return; } - if (ITimestampBased::canHandleIndex(index)) { ITimestampBased::setPropertyByIndex(variant, index); return; } + if (ITimestampBased::canHandleIndex(index)) { ITimestampBased::setPropertyByIndex(index, variant); return; } ColumnIndex i = index.frontCasted(); 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(); switch (i) diff --git a/src/blackmisc/aviation/aircraftparts.h b/src/blackmisc/aviation/aircraftparts.h index ed510b4a3..8753bff1b 100644 --- a/src/blackmisc/aviation/aircraftparts.h +++ b/src/blackmisc/aviation/aircraftparts.h @@ -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; } diff --git a/src/blackmisc/aviation/aircraftsituation.cpp b/src/blackmisc/aviation/aircraftsituation.cpp index 8ab89225d..53889ff17 100644 --- a/src/blackmisc/aviation/aircraftsituation.cpp +++ b/src/blackmisc/aviation/aircraftsituation.cpp @@ -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(); 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; } } diff --git a/src/blackmisc/aviation/aircraftsituation.h b/src/blackmisc/aviation/aircraftsituation.h index 6aa03598a..457ea888a 100644 --- a/src/blackmisc/aviation/aircraftsituation.h +++ b/src/blackmisc/aviation/aircraftsituation.h @@ -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; } diff --git a/src/blackmisc/aviation/airlineicaocode.cpp b/src/blackmisc/aviation/airlineicaocode.cpp index cfc3579c7..fbd5c7582 100644 --- a/src/blackmisc/aviation/airlineicaocode.cpp +++ b/src/blackmisc/aviation/airlineicaocode.cpp @@ -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(); return; } - if (IDatastoreObjectWithIntegerKey::canHandleIndex(index)) { IDatastoreObjectWithIntegerKey::setPropertyByIndex(variant, index); return; } + if (IDatastoreObjectWithIntegerKey::canHandleIndex(index)) { IDatastoreObjectWithIntegerKey::setPropertyByIndex(index, variant); return; } ColumnIndex i = index.frontCasted(); 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(); + if (IDatastoreObjectWithIntegerKey::canHandleIndex(index)) { return IDatastoreObjectWithIntegerKey::comparePropertyByIndex(index, compareValue);} + const ColumnIndex i = index.frontCasted(); 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 diff --git a/src/blackmisc/aviation/airlineicaocode.h b/src/blackmisc/aviation/airlineicaocode.h index b3c960f3b..c51c06809 100644 --- a/src/blackmisc/aviation/airlineicaocode.h +++ b/src/blackmisc/aviation/airlineicaocode.h @@ -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; diff --git a/src/blackmisc/aviation/airport.cpp b/src/blackmisc/aviation/airport.cpp index 2766ee85e..3c0603335 100644 --- a/src/blackmisc/aviation/airport.cpp +++ b/src/blackmisc/aviation/airport.cpp @@ -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(); return; } ColumnIndex i = index.frontCasted(); 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(); 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; } diff --git a/src/blackmisc/aviation/airport.h b/src/blackmisc/aviation/airport.h index 2922ae0fc..920c6a21c 100644 --- a/src/blackmisc/aviation/airport.h +++ b/src/blackmisc/aviation/airport.h @@ -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; diff --git a/src/blackmisc/aviation/airporticaocode.cpp b/src/blackmisc/aviation/airporticaocode.cpp index ff20564f5..9beaefbb4 100644 --- a/src/blackmisc/aviation/airporticaocode.cpp +++ b/src/blackmisc/aviation/airporticaocode.cpp @@ -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); diff --git a/src/blackmisc/aviation/airporticaocode.h b/src/blackmisc/aviation/airporticaocode.h index 4d66c85de..503b1d6fc 100644 --- a/src/blackmisc/aviation/airporticaocode.h +++ b/src/blackmisc/aviation/airporticaocode.h @@ -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; diff --git a/src/blackmisc/aviation/atcstation.cpp b/src/blackmisc/aviation/atcstation.cpp index edaa8fb9a..749176844 100644 --- a/src/blackmisc/aviation/atcstation.cpp +++ b/src/blackmisc/aviation/atcstation.cpp @@ -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(); return; } ColumnIndex i = index.frontCasted(); @@ -396,37 +396,37 @@ namespace BlackMisc this->setBookedUntilUtc(variant.value()); 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()); 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; } } diff --git a/src/blackmisc/aviation/atcstation.h b/src/blackmisc/aviation/atcstation.h index 73c97566f..e7e8841a7 100644 --- a/src/blackmisc/aviation/atcstation.h +++ b/src/blackmisc/aviation/atcstation.h @@ -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; diff --git a/src/blackmisc/aviation/callsign.cpp b/src/blackmisc/aviation/callsign.cpp index b345b03fd..1b6f23ab8 100644 --- a/src/blackmisc/aviation/callsign.cpp +++ b/src/blackmisc/aviation/callsign.cpp @@ -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(); return; } ColumnIndex i = index.frontCasted(); @@ -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(); diff --git a/src/blackmisc/aviation/callsign.h b/src/blackmisc/aviation/callsign.h index bde0f4a84..78e9e3e81 100644 --- a/src/blackmisc/aviation/callsign.h +++ b/src/blackmisc/aviation/callsign.h @@ -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; diff --git a/src/blackmisc/aviation/livery.cpp b/src/blackmisc/aviation/livery.cpp index de6ba52d4..23a800090 100644 --- a/src/blackmisc/aviation/livery.cpp +++ b/src/blackmisc/aviation/livery.cpp @@ -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(); return; } - if (IDatastoreObjectWithIntegerKey::canHandleIndex(index)) { IDatastoreObjectWithIntegerKey::setPropertyByIndex(variant, index); return; } + if (IDatastoreObjectWithIntegerKey::canHandleIndex(index)) { IDatastoreObjectWithIntegerKey::setPropertyByIndex(index, variant); return; } ColumnIndex i = index.frontCasted(); 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(); 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: diff --git a/src/blackmisc/aviation/livery.h b/src/blackmisc/aviation/livery.h index 4c328435c..13e4e222e 100644 --- a/src/blackmisc/aviation/livery.h +++ b/src/blackmisc/aviation/livery.h @@ -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; diff --git a/src/blackmisc/aviation/modulator.cpp b/src/blackmisc/aviation/modulator.cpp index 0e589df1b..43b5d42ee 100644 --- a/src/blackmisc/aviation/modulator.cpp +++ b/src/blackmisc/aviation/modulator.cpp @@ -125,17 +125,17 @@ namespace BlackMisc } template - void CModulator::setPropertyByIndex(const CVariant &variant, const CPropertyIndex &index) + void CModulator::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(); 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>::setPropertyByIndex(variant, index); + CValueObject>::setPropertyByIndex(index, variant); break; } } diff --git a/src/blackmisc/aviation/modulator.h b/src/blackmisc/aviation/modulator.h index f60e7666c..16f65f542 100644 --- a/src/blackmisc/aviation/modulator.h +++ b/src/blackmisc/aviation/modulator.h @@ -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; diff --git a/src/blackmisc/aviation/track.cpp b/src/blackmisc/aviation/track.cpp index 4952946bc..bf9d18030 100644 --- a/src/blackmisc/aviation/track.cpp +++ b/src/blackmisc/aviation/track.cpp @@ -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 diff --git a/src/blackmisc/aviation/transponder.cpp b/src/blackmisc/aviation/transponder.cpp index 0d6260fd8..a65110ab2 100644 --- a/src/blackmisc/aviation/transponder.cpp +++ b/src/blackmisc/aviation/transponder.cpp @@ -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(); return; } ColumnIndex i = index.frontCasted(); diff --git a/src/blackmisc/aviation/transponder.h b/src/blackmisc/aviation/transponder.h index f41d5b31c..29c001f5f 100644 --- a/src/blackmisc/aviation/transponder.h +++ b/src/blackmisc/aviation/transponder.h @@ -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); diff --git a/src/blackmisc/country.cpp b/src/blackmisc/country.cpp index 77e3f8366..00d3c0fc1 100644 --- a/src/blackmisc/country.cpp +++ b/src/blackmisc/country.cpp @@ -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(); return; } ColumnIndex i = index.frontCasted(); @@ -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(); switch (i) { @@ -165,5 +164,4 @@ namespace BlackMisc { return isoCode.length() == 2; } - } // namespace diff --git a/src/blackmisc/country.h b/src/blackmisc/country.h index 863edfb05..7c5cc431e 100644 --- a/src/blackmisc/country.h +++ b/src/blackmisc/country.h @@ -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()); diff --git a/src/blackmisc/datastore.cpp b/src/blackmisc/datastore.cpp index 49ed97175..8e1690c81 100644 --- a/src/blackmisc/datastore.cpp +++ b/src/blackmisc/datastore.cpp @@ -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(); 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(); + if (ITimestampBased::canHandleIndex(index)) { return ITimestampBased::comparePropertyByIndex(index, compareValue); } + const ColumnIndex i = index.frontCasted(); 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(); 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(); switch (i) { diff --git a/src/blackmisc/datastore.h b/src/blackmisc/datastore.h index 6916bfc34..24e10be63 100644 --- a/src/blackmisc/datastore.h +++ b/src/blackmisc/datastore.h @@ -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); diff --git a/src/blackmisc/geo/coordinategeodetic.cpp b/src/blackmisc/geo/coordinategeodetic.cpp index 38f35feb1..83e3f5df9 100644 --- a/src/blackmisc/geo/coordinategeodetic.cpp +++ b/src/blackmisc/geo/coordinategeodetic.cpp @@ -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(); return; } ICoordinateGeodetic::ColumnIndex i = index.frontCasted(); 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()); @@ -153,7 +153,7 @@ namespace BlackMisc this->setNormalVector(variant.value()); break; default: - CValueObject::setPropertyByIndex(variant, index); + CValueObject::setPropertyByIndex(index, variant); break; } } diff --git a/src/blackmisc/geo/coordinategeodetic.h b/src/blackmisc/geo/coordinategeodetic.h index fec35f628..77cc02514 100644 --- a/src/blackmisc/geo/coordinategeodetic.h +++ b/src/blackmisc/geo/coordinategeodetic.h @@ -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); diff --git a/src/blackmisc/identifier.cpp b/src/blackmisc/identifier.cpp index 3cd4d4f33..02978dd3a 100644 --- a/src/blackmisc/identifier.cpp +++ b/src/blackmisc/identifier.cpp @@ -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 diff --git a/src/blackmisc/identifier.h b/src/blackmisc/identifier.h index c49aa4cad..2ed88f2bb 100644 --- a/src/blackmisc/identifier.h +++ b/src/blackmisc/identifier.h @@ -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 diff --git a/src/blackmisc/input/actionhotkey.cpp b/src/blackmisc/input/actionhotkey.cpp index 2d8356870..bd0a70d86 100644 --- a/src/blackmisc/input/actionhotkey.cpp +++ b/src/blackmisc/input/actionhotkey.cpp @@ -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(); return; } ColumnIndex i = index.frontCasted(); @@ -85,7 +85,7 @@ namespace BlackMisc this->setObject(variant.value()); break; default: - CValueObject::setPropertyByIndex(variant, index); + CValueObject::setPropertyByIndex(index, variant); break; } } diff --git a/src/blackmisc/input/actionhotkey.h b/src/blackmisc/input/actionhotkey.h index 7d80e514a..da8bc6db0 100644 --- a/src/blackmisc/input/actionhotkey.h +++ b/src/blackmisc/input/actionhotkey.h @@ -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; diff --git a/src/blackmisc/input/joystickbutton.cpp b/src/blackmisc/input/joystickbutton.cpp index 7a242fa0d..64f9b654a 100644 --- a/src/blackmisc/input/joystickbutton.cpp +++ b/src/blackmisc/input/joystickbutton.cpp @@ -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(); return; } ColumnIndex i = index.frontCasted(); diff --git a/src/blackmisc/input/joystickbutton.h b/src/blackmisc/input/joystickbutton.h index 7179ab6cb..5692a65df 100644 --- a/src/blackmisc/input/joystickbutton.h +++ b/src/blackmisc/input/joystickbutton.h @@ -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; diff --git a/src/blackmisc/input/keyboardkey.cpp b/src/blackmisc/input/keyboardkey.cpp index 05ed82b53..1a3a8a0ab 100644 --- a/src/blackmisc/input/keyboardkey.cpp +++ b/src/blackmisc/input/keyboardkey.cpp @@ -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(); return; } ColumnIndex i = index.frontCasted(); diff --git a/src/blackmisc/input/keyboardkey.h b/src/blackmisc/input/keyboardkey.h index e334961bb..45ad9ba22 100644 --- a/src/blackmisc/input/keyboardkey.h +++ b/src/blackmisc/input/keyboardkey.h @@ -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; diff --git a/src/blackmisc/namevariantpair.cpp b/src/blackmisc/namevariantpair.cpp index e35d6b7f0..63aa9f3ec 100644 --- a/src/blackmisc/namevariantpair.cpp +++ b/src/blackmisc/namevariantpair.cpp @@ -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(); return; } ColumnIndex i = index.frontCasted(); @@ -77,7 +76,7 @@ namespace BlackMisc this->m_variant = variant; break; default: - CValueObject::setPropertyByIndex(variant, index); + CValueObject::setPropertyByIndex(index, variant); break; } } diff --git a/src/blackmisc/namevariantpair.h b/src/blackmisc/namevariantpair.h index 6fac5090d..dcd598da4 100644 --- a/src/blackmisc/namevariantpair.h +++ b/src/blackmisc/namevariantpair.h @@ -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; diff --git a/src/blackmisc/network/authenticateduser.cpp b/src/blackmisc/network/authenticateduser.cpp index 7086ba391..e2c0d41a5 100644 --- a/src/blackmisc/network/authenticateduser.cpp +++ b/src/blackmisc/network/authenticateduser.cpp @@ -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(); return; } - if (IDatastoreObjectWithIntegerKey::canHandleIndex(index)) { IDatastoreObjectWithIntegerKey::setPropertyByIndex(variant, index); return; } + if (IDatastoreObjectWithIntegerKey::canHandleIndex(index)) { IDatastoreObjectWithIntegerKey::setPropertyByIndex(index, variant); return; } ColumnIndex i = index.frontCasted(); switch (i) { @@ -139,7 +139,7 @@ namespace BlackMisc this->setRealName(variant.value()); break; default: - CValueObject::setPropertyByIndex(variant, index); + CValueObject::setPropertyByIndex(index, variant); break; } } diff --git a/src/blackmisc/network/authenticateduser.h b/src/blackmisc/network/authenticateduser.h index b3483eeeb..810fcb6e8 100644 --- a/src/blackmisc/network/authenticateduser.h +++ b/src/blackmisc/network/authenticateduser.h @@ -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; diff --git a/src/blackmisc/network/client.cpp b/src/blackmisc/network/client.cpp index 0203d51eb..403d372ff 100644 --- a/src/blackmisc/network/client.cpp +++ b/src/blackmisc/network/client.cpp @@ -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(); return; } ColumnIndex i = index.frontCasted(); @@ -109,22 +109,22 @@ namespace BlackMisc this->m_capabilities = variant.value(); 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()); 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; } } diff --git a/src/blackmisc/network/client.h b/src/blackmisc/network/client.h index 1aa262a2a..b0792913d 100644 --- a/src/blackmisc/network/client.h +++ b/src/blackmisc/network/client.h @@ -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; diff --git a/src/blackmisc/network/role.cpp b/src/blackmisc/network/role.cpp index 47b2b3d87..b77f367c8 100644 --- a/src/blackmisc/network/role.cpp +++ b/src/blackmisc/network/role.cpp @@ -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(); return; } - if (IDatastoreObjectWithIntegerKey::canHandleIndex(index)) { IDatastoreObjectWithIntegerKey::setPropertyByIndex(variant, index); return; } + if (IDatastoreObjectWithIntegerKey::canHandleIndex(index)) { IDatastoreObjectWithIntegerKey::setPropertyByIndex(index, variant); return; } ColumnIndex i = index.frontCasted(); switch (i) { @@ -54,7 +54,7 @@ namespace BlackMisc case IndexDescription: this->setDescription(variant.value()); default: - CValueObject::setPropertyByIndex(variant, index); + CValueObject::setPropertyByIndex(index, variant); break; } } diff --git a/src/blackmisc/network/role.h b/src/blackmisc/network/role.h index 7670d56f0..aa518300a 100644 --- a/src/blackmisc/network/role.h +++ b/src/blackmisc/network/role.h @@ -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); diff --git a/src/blackmisc/network/server.cpp b/src/blackmisc/network/server.cpp index 3c4cbfaca..1dc04293f 100644 --- a/src/blackmisc/network/server.cpp +++ b/src/blackmisc/network/server.cpp @@ -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(); return; } ColumnIndex i = index.frontCasted(); @@ -110,13 +110,13 @@ namespace BlackMisc this->setName(variant.value()); break; case IndexUser: - this->m_user.setPropertyByIndex(variant, index.copyFrontRemoved()); + this->m_user.setPropertyByIndex(index.copyFrontRemoved(), variant); break; case IndexIsAcceptingConnections: this->setIsAcceptingConnections(variant.value()); break; default: - CValueObject::setPropertyByIndex(variant, index); + CValueObject::setPropertyByIndex(index, variant); break; } } diff --git a/src/blackmisc/network/server.h b/src/blackmisc/network/server.h index 67c8e697b..f5ce3a3fc 100644 --- a/src/blackmisc/network/server.h +++ b/src/blackmisc/network/server.h @@ -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; diff --git a/src/blackmisc/network/textmessage.cpp b/src/blackmisc/network/textmessage.cpp index d502cad4a..688b8a9f6 100644 --- a/src/blackmisc/network/textmessage.cpp +++ b/src/blackmisc/network/textmessage.cpp @@ -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(); return; } - if (ITimestampBased::canHandleIndex(index)) { ITimestampBased::setPropertyByIndex(variant, index); return; } + if (ITimestampBased::canHandleIndex(index)) { ITimestampBased::setPropertyByIndex(index, variant); return; } ColumnIndex i = index.frontCasted(); 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(); break; default: - CValueObject::setPropertyByIndex(variant, index); + CValueObject::setPropertyByIndex(index, variant); break; } } diff --git a/src/blackmisc/network/textmessage.h b/src/blackmisc/network/textmessage.h index f684c8e9b..a503d47f3 100644 --- a/src/blackmisc/network/textmessage.h +++ b/src/blackmisc/network/textmessage.h @@ -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; diff --git a/src/blackmisc/network/url.cpp b/src/blackmisc/network/url.cpp index 676f9b764..dd8e3d346 100644 --- a/src/blackmisc/network/url.cpp +++ b/src/blackmisc/network/url.cpp @@ -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(); return; } ColumnIndex i = index.frontCasted(); @@ -257,7 +257,7 @@ namespace BlackMisc this->setScheme(variant.value()); break; default: - CValueObject::setPropertyByIndex(variant, index); + CValueObject::setPropertyByIndex(index, variant); break; } } diff --git a/src/blackmisc/network/url.h b/src/blackmisc/network/url.h index 9fc1fcdb7..1cca57d42 100644 --- a/src/blackmisc/network/url.h +++ b/src/blackmisc/network/url.h @@ -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; diff --git a/src/blackmisc/network/user.cpp b/src/blackmisc/network/user.cpp index 201d2105b..da8c0b361 100644 --- a/src/blackmisc/network/user.cpp +++ b/src/blackmisc/network/user.cpp @@ -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(); return; } ColumnIndex i = index.frontCasted(); @@ -207,18 +207,18 @@ namespace BlackMisc this->setRealName(variant.value()); 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(); @@ -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; } diff --git a/src/blackmisc/network/user.h b/src/blackmisc/network/user.h index 4649292a3..d814747c6 100644 --- a/src/blackmisc/network/user.h +++ b/src/blackmisc/network/user.h @@ -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); diff --git a/src/blackmisc/orderable.cpp b/src/blackmisc/orderable.cpp index 5a7c65eee..fb9afee84 100644 --- a/src/blackmisc/orderable.cpp +++ b/src/blackmisc/orderable.cpp @@ -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::max(); diff --git a/src/blackmisc/orderable.h b/src/blackmisc/orderable.h index 7cbf2040c..287988f8d 100644 --- a/src/blackmisc/orderable.h +++ b/src/blackmisc/orderable.h @@ -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 }; diff --git a/src/blackmisc/pq/physicalquantity.cpp b/src/blackmisc/pq/physicalquantity.cpp index 32a3fe1ee..67a0fe4be 100644 --- a/src/blackmisc/pq/physicalquantity.cpp +++ b/src/blackmisc/pq/physicalquantity.cpp @@ -369,7 +369,7 @@ namespace BlackMisc } template - void CPhysicalQuantity::setPropertyByIndex(const CVariant &variant, const CPropertyIndex &index) + void CPhysicalQuantity::setPropertyByIndex(const CPropertyIndex &index, const CVariant &variant) { if (index.isMyself()) { (*this) = variant.to(); return; } ColumnIndex i = index.frontCasted(); @@ -389,13 +389,13 @@ namespace BlackMisc this->parseFromString(variant.toQString()); break; default: - Mixin::Index::setPropertyByIndex(variant, index); + Mixin::Index::setPropertyByIndex(index, variant); break; } } template - int CPhysicalQuantity::comparePropertyByIndex(const PQ &pq, const CPropertyIndex &index) const + int CPhysicalQuantity::comparePropertyByIndex(const CPropertyIndex &index, const PQ &pq) const { if (index.isMyself()) { return compareImpl(*derived(), pq); } ColumnIndex i = index.frontCasted(); diff --git a/src/blackmisc/pq/physicalquantity.h b/src/blackmisc/pq/physicalquantity.h index 5eae94175..fee50ad9c 100644 --- a/src/blackmisc/pq/physicalquantity.h +++ b/src/blackmisc/pq/physicalquantity.h @@ -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; diff --git a/src/blackmisc/propertyindexvariantmap.h b/src/blackmisc/propertyindexvariantmap.h index 981482b9b..3149a5520 100644 --- a/src/blackmisc/propertyindexvariantmap.h +++ b/src/blackmisc/propertyindexvariantmap.h @@ -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 CVariant basePropertyByIndex(const T *base, const CPropertyIndex &index) const { return base->propertyByIndex(index); } template - 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 - void Index::setPropertyByIndex(const CVariant &variant, const CPropertyIndex &index) + void Index::setPropertyByIndex(const CPropertyIndex &index, const CVariant &variant) { if (index.isMyself()) { diff --git a/src/blackmisc/rgbcolor.cpp b/src/blackmisc/rgbcolor.cpp index f02ee1749..d6cd3b078 100644 --- a/src/blackmisc/rgbcolor.cpp +++ b/src/blackmisc/rgbcolor.cpp @@ -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(); return; } ColumnIndex i = index.frontCasted(); @@ -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(); diff --git a/src/blackmisc/rgbcolor.h b/src/blackmisc/rgbcolor.h index f50d9a072..0479902bf 100644 --- a/src/blackmisc/rgbcolor.h +++ b/src/blackmisc/rgbcolor.h @@ -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; diff --git a/src/blackmisc/simulation/aircraftmodel.cpp b/src/blackmisc/simulation/aircraftmodel.cpp index cbfaeacdf..49da5e347 100644 --- a/src/blackmisc/simulation/aircraftmodel.cpp +++ b/src/blackmisc/simulation/aircraftmodel.cpp @@ -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(); 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(); 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(); 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: diff --git a/src/blackmisc/simulation/aircraftmodel.h b/src/blackmisc/simulation/aircraftmodel.h index e9ae4027f..f386f102c 100644 --- a/src/blackmisc/simulation/aircraftmodel.h +++ b/src/blackmisc/simulation/aircraftmodel.h @@ -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; diff --git a/src/blackmisc/simulation/airspaceaircraftsnapshot.cpp b/src/blackmisc/simulation/airspaceaircraftsnapshot.cpp index 31cf43425..3188c39af 100644 --- a/src/blackmisc/simulation/airspaceaircraftsnapshot.cpp +++ b/src/blackmisc/simulation/airspaceaircraftsnapshot.cpp @@ -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(); return; } - CValueObject::setPropertyByIndex(variant, index); + CValueObject::setPropertyByIndex(index, variant); } QString CAirspaceAircraftSnapshot::convertToQString(bool i18n) const diff --git a/src/blackmisc/simulation/airspaceaircraftsnapshot.h b/src/blackmisc/simulation/airspaceaircraftsnapshot.h index c1a0cf088..ee3028036 100644 --- a/src/blackmisc/simulation/airspaceaircraftsnapshot.h +++ b/src/blackmisc/simulation/airspaceaircraftsnapshot.h @@ -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; diff --git a/src/blackmisc/simulation/distributor.cpp b/src/blackmisc/simulation/distributor.cpp index baa2075f1..0a82a4c65 100644 --- a/src/blackmisc/simulation/distributor.cpp +++ b/src/blackmisc/simulation/distributor.cpp @@ -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(); 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(); switch (i) @@ -83,25 +83,25 @@ namespace BlackMisc this->m_description = variant.value(); 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(); 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; } diff --git a/src/blackmisc/simulation/distributor.h b/src/blackmisc/simulation/distributor.h index cb0510a9a..901fb31e9 100644 --- a/src/blackmisc/simulation/distributor.h +++ b/src/blackmisc/simulation/distributor.h @@ -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; diff --git a/src/blackmisc/simulation/fscommon/aircraftcfgentries.cpp b/src/blackmisc/simulation/fscommon/aircraftcfgentries.cpp index 4fa1fec51..97d00ce62 100644 --- a/src/blackmisc/simulation/fscommon/aircraftcfgentries.cpp +++ b/src/blackmisc/simulation/fscommon/aircraftcfgentries.cpp @@ -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(); return; } - if (ITimestampBased::canHandleIndex(index)) { ITimestampBased::setPropertyByIndex(variant, index); return; } + if (ITimestampBased::canHandleIndex(index)) { ITimestampBased::setPropertyByIndex(index, variant); return; } ColumnIndex i = index.frontCasted(); 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; } } diff --git a/src/blackmisc/simulation/fscommon/aircraftcfgentries.h b/src/blackmisc/simulation/fscommon/aircraftcfgentries.h index af4a14dc6..44920ceae 100644 --- a/src/blackmisc/simulation/fscommon/aircraftcfgentries.h +++ b/src/blackmisc/simulation/fscommon/aircraftcfgentries.h @@ -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; diff --git a/src/blackmisc/simulation/fscommon/vpilotmodelrule.cpp b/src/blackmisc/simulation/fscommon/vpilotmodelrule.cpp index ae8760b5d..5c2de29e2 100644 --- a/src/blackmisc/simulation/fscommon/vpilotmodelrule.cpp +++ b/src/blackmisc/simulation/fscommon/vpilotmodelrule.cpp @@ -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(); return; } - if (ITimestampBased::canHandleIndex(index)) { ITimestampBased::setPropertyByIndex(variant, index); return; } + if (ITimestampBased::canHandleIndex(index)) { ITimestampBased::setPropertyByIndex(index, variant); return; } ColumnIndex i = index.frontCasted(); switch (i) { @@ -76,7 +76,7 @@ namespace BlackMisc case IndexTypeCode: this->setTypeCode(variant.value()); break; case IndexCallsignPrefix: this->setCallsignPrefix(variant.value()); break; default: - CValueObject::setPropertyByIndex(variant, index); + CValueObject::setPropertyByIndex(index, variant); break; } } diff --git a/src/blackmisc/simulation/fscommon/vpilotmodelrule.h b/src/blackmisc/simulation/fscommon/vpilotmodelrule.h index d32664011..961b50593 100644 --- a/src/blackmisc/simulation/fscommon/vpilotmodelrule.h +++ b/src/blackmisc/simulation/fscommon/vpilotmodelrule.h @@ -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; diff --git a/src/blackmisc/simulation/simulatedaircraft.cpp b/src/blackmisc/simulation/simulatedaircraft.cpp index da0d4f3c9..9c81dd521 100644 --- a/src/blackmisc/simulation/simulatedaircraft.cpp +++ b/src/blackmisc/simulation/simulatedaircraft.cpp @@ -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(); return; } ColumnIndex i = index.frontCasted(); 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(); 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: diff --git a/src/blackmisc/simulation/simulatedaircraft.h b/src/blackmisc/simulation/simulatedaircraft.h index c516a73ec..9b4ec33c7 100644 --- a/src/blackmisc/simulation/simulatedaircraft.h +++ b/src/blackmisc/simulation/simulatedaircraft.h @@ -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; } diff --git a/src/blackmisc/simulation/simulatorinfo.cpp b/src/blackmisc/simulation/simulatorinfo.cpp index f42b8b1e8..aaf0bc109 100644 --- a/src/blackmisc/simulation/simulatorinfo.cpp +++ b/src/blackmisc/simulation/simulatorinfo.cpp @@ -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); diff --git a/src/blackmisc/simulation/simulatorinfo.h b/src/blackmisc/simulation/simulatorinfo.h index d1387cf5b..2e3bdd58b 100644 --- a/src/blackmisc/simulation/simulatorinfo.h +++ b/src/blackmisc/simulation/simulatorinfo.h @@ -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; diff --git a/src/blackmisc/simulation/simulatorsetup.cpp b/src/blackmisc/simulation/simulatorsetup.cpp index 9b09e75fe..7ebffe4b9 100644 --- a/src/blackmisc/simulation/simulatorsetup.cpp +++ b/src/blackmisc/simulation/simulatorsetup.cpp @@ -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(); return; } ColumnIndex i = index.frontCasted(); @@ -78,7 +78,7 @@ namespace BlackMisc this->m_data = variant.to(); break; default: - CValueObject::setPropertyByIndex(variant, index); + CValueObject::setPropertyByIndex(index, variant); break; } } diff --git a/src/blackmisc/simulation/simulatorsetup.h b/src/blackmisc/simulation/simulatorsetup.h index 3fb8227f3..885bcfa3c 100644 --- a/src/blackmisc/simulation/simulatorsetup.h +++ b/src/blackmisc/simulation/simulatorsetup.h @@ -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(); diff --git a/src/blackmisc/simulation/xplane/navdatareference.cpp b/src/blackmisc/simulation/xplane/navdatareference.cpp index d962b6417..b98c29c4f 100644 --- a/src/blackmisc/simulation/xplane/navdatareference.cpp +++ b/src/blackmisc/simulation/xplane/navdatareference.cpp @@ -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(); return; } - CValueObject::setPropertyByIndex(variant, index); + CValueObject::setPropertyByIndex(index, variant); } QString CNavDataReference::convertToQString(bool i18n) const diff --git a/src/blackmisc/simulation/xplane/navdatareference.h b/src/blackmisc/simulation/xplane/navdatareference.h index 1e0f7d352..4e281d325 100644 --- a/src/blackmisc/simulation/xplane/navdatareference.h +++ b/src/blackmisc/simulation/xplane/navdatareference.h @@ -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; diff --git a/src/blackmisc/statusmessage.cpp b/src/blackmisc/statusmessage.cpp index b784d0524..269312da8 100644 --- a/src/blackmisc/statusmessage.cpp +++ b/src/blackmisc/statusmessage.cpp @@ -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(); return; } - if (ITimestampBased::canHandleIndex(index)) { ITimestampBased::setPropertyByIndex(variant, index); return; } + if (ITimestampBased::canHandleIndex(index)) { ITimestampBased::setPropertyByIndex(index, variant); return; } ColumnIndex i = index.frontCasted(); switch (i) { @@ -423,15 +423,15 @@ namespace BlackMisc this->m_categories = variant.value(); 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(); switch (i) { diff --git a/src/blackmisc/statusmessage.h b/src/blackmisc/statusmessage.h index 46454d725..9783bc745 100644 --- a/src/blackmisc/statusmessage.h +++ b/src/blackmisc/statusmessage.h @@ -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; diff --git a/src/blackmisc/testing.cpp b/src/blackmisc/testing.cpp index bf0224bca..749c7f0bb 100644 --- a/src/blackmisc/testing.cpp +++ b/src/blackmisc/testing.cpp @@ -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); } diff --git a/src/blackmisc/timestampbased.cpp b/src/blackmisc/timestampbased.cpp index 59fed15d7..030df9051 100644 --- a/src/blackmisc/timestampbased.cpp +++ b/src/blackmisc/timestampbased.cpp @@ -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); diff --git a/src/blackmisc/timestampbased.h b/src/blackmisc/timestampbased.h index dfba42005..7bd4a7a1a 100644 --- a/src/blackmisc/timestampbased.h +++ b/src/blackmisc/timestampbased.h @@ -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 }; diff --git a/src/blackmisc/variant.cpp b/src/blackmisc/variant.cpp index fbeb1fbe7..8e47eb031 100644 --- a/src/blackmisc/variant.cpp +++ b/src/blackmisc/variant.cpp @@ -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); diff --git a/src/blackmisc/variant.h b/src/blackmisc/variant.h index d450e079d..f44adeb33 100644 --- a/src/blackmisc/variant.h +++ b/src/blackmisc/variant.h @@ -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; diff --git a/src/blackmisc/variantprivate.h b/src/blackmisc/variantprivate.h index 70163f950..1b406fe86 100644 --- a/src/blackmisc/variantprivate.h +++ b/src/blackmisc/variantprivate.h @@ -121,7 +121,7 @@ namespace BlackMisc static int compareImpl(const T &lhs, const T&, ...) { throw CVariantException(lhs, "compare"); } template - static void setPropertyByIndex(T &object, const CVariant &variant, const CPropertyIndex &index, decltype(static_cast(object.setPropertyByIndex(variant, index)), 0)) { object.setPropertyByIndex(variant, index); } + static void setPropertyByIndex(T &object, const CVariant &variant, const CPropertyIndex &index, decltype(static_cast(object.setPropertyByIndex(index, variant)), 0)) { object.setPropertyByIndex(index, variant); } template static void setPropertyByIndex(T &object, const CVariant &, const CPropertyIndex &, ...) { throw CVariantException(object, "setPropertyByIndex"); } diff --git a/src/blackmisc/weather/cloudlayer.cpp b/src/blackmisc/weather/cloudlayer.cpp index 18ab79812..4fbab6464 100644 --- a/src/blackmisc/weather/cloudlayer.cpp +++ b/src/blackmisc/weather/cloudlayer.cpp @@ -72,7 +72,7 @@ namespace BlackMisc } } - void CCloudLayer::setPropertyByIndex(const CVariant &variant, const BlackMisc::CPropertyIndex &index) + void CCloudLayer::setPropertyByIndex(const CPropertyIndex &index, const CVariant &variant) { if (index.isMyself()) { (*this) = variant.to(); return; } ColumnIndex i = index.frontCasted(); @@ -88,7 +88,7 @@ namespace BlackMisc setCoveragePercent(variant.value()); break; default: - CValueObject::setPropertyByIndex(variant, index); + CValueObject::setPropertyByIndex(index, variant); break; } } diff --git a/src/blackmisc/weather/cloudlayer.h b/src/blackmisc/weather/cloudlayer.h index 840ba93ac..1f64e2476 100644 --- a/src/blackmisc/weather/cloudlayer.h +++ b/src/blackmisc/weather/cloudlayer.h @@ -125,7 +125,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; diff --git a/src/blackmisc/weather/gridpoint.cpp b/src/blackmisc/weather/gridpoint.cpp index 6f020a386..8e4cdb154 100644 --- a/src/blackmisc/weather/gridpoint.cpp +++ b/src/blackmisc/weather/gridpoint.cpp @@ -73,7 +73,7 @@ namespace BlackMisc } } - void CGridPoint::setPropertyByIndex(const CVariant &variant, const BlackMisc::CPropertyIndex &index) + void CGridPoint::setPropertyByIndex(const CPropertyIndex &index, const CVariant &variant) { if (index.isMyself()) { (*this) = variant.to(); return; } ColumnIndex i = index.frontCasted(); @@ -98,7 +98,7 @@ namespace BlackMisc setSurfacePressure(variant.value()); break; default: - CValueObject::setPropertyByIndex(variant, index); + CValueObject::setPropertyByIndex(index, variant); break; } } diff --git a/src/blackmisc/weather/gridpoint.h b/src/blackmisc/weather/gridpoint.h index 9754361de..5d5f6b053 100644 --- a/src/blackmisc/weather/gridpoint.h +++ b/src/blackmisc/weather/gridpoint.h @@ -108,7 +108,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; diff --git a/src/blackmisc/weather/presentweather.cpp b/src/blackmisc/weather/presentweather.cpp index 8bc81528e..ae4169ef8 100644 --- a/src/blackmisc/weather/presentweather.cpp +++ b/src/blackmisc/weather/presentweather.cpp @@ -44,7 +44,7 @@ namespace BlackMisc } } - void CPresentWeather::setPropertyByIndex(const CVariant &variant, const BlackMisc::CPropertyIndex &index) + void CPresentWeather::setPropertyByIndex(const CPropertyIndex &index, const CVariant &variant) { if (index.isMyself()) { (*this) = variant.to(); return; } ColumnIndex i = index.frontCasted(); @@ -60,7 +60,7 @@ namespace BlackMisc setWeatherPhenomena(variant.toInt()); break; default: - CValueObject::setPropertyByIndex(variant, index); + CValueObject::setPropertyByIndex(index, variant); break; } } diff --git a/src/blackmisc/weather/presentweather.h b/src/blackmisc/weather/presentweather.h index 5cc0cf5af..1738891fe 100644 --- a/src/blackmisc/weather/presentweather.h +++ b/src/blackmisc/weather/presentweather.h @@ -118,7 +118,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; diff --git a/src/blackmisc/weather/temperaturelayer.cpp b/src/blackmisc/weather/temperaturelayer.cpp index 15cb41d8d..fc0e89fac 100644 --- a/src/blackmisc/weather/temperaturelayer.cpp +++ b/src/blackmisc/weather/temperaturelayer.cpp @@ -46,7 +46,7 @@ namespace BlackMisc } } - void CTemperatureLayer::setPropertyByIndex(const CVariant &variant, const BlackMisc::CPropertyIndex &index) + void CTemperatureLayer::setPropertyByIndex(const CPropertyIndex &index, const CVariant &variant) { if (index.isMyself()) { (*this) = variant.to(); return; } ColumnIndex i = index.frontCasted(); @@ -62,7 +62,7 @@ namespace BlackMisc setRelativeHumidity(variant.value()); break; default: - CValueObject::setPropertyByIndex(variant, index); + CValueObject::setPropertyByIndex(index, variant); break; } } diff --git a/src/blackmisc/weather/temperaturelayer.h b/src/blackmisc/weather/temperaturelayer.h index df7f59c6d..989161c09 100644 --- a/src/blackmisc/weather/temperaturelayer.h +++ b/src/blackmisc/weather/temperaturelayer.h @@ -74,7 +74,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; diff --git a/src/blackmisc/weather/visibilitylayer.cpp b/src/blackmisc/weather/visibilitylayer.cpp index 4ce2f9440..73cb90bfe 100644 --- a/src/blackmisc/weather/visibilitylayer.cpp +++ b/src/blackmisc/weather/visibilitylayer.cpp @@ -42,7 +42,7 @@ namespace BlackMisc } } - void CVisibilityLayer::setPropertyByIndex(const CVariant &variant, const BlackMisc::CPropertyIndex &index) + void CVisibilityLayer::setPropertyByIndex(const CPropertyIndex &index, const CVariant &variant) { if (index.isMyself()) { (*this) = variant.to(); return; } ColumnIndex i = index.frontCasted(); @@ -58,7 +58,7 @@ namespace BlackMisc setVisibility(variant.value()); break; default: - CValueObject::setPropertyByIndex(variant, index); + CValueObject::setPropertyByIndex(index, variant); break; } } diff --git a/src/blackmisc/weather/visibilitylayer.h b/src/blackmisc/weather/visibilitylayer.h index 19de64e1e..f100ae3f2 100644 --- a/src/blackmisc/weather/visibilitylayer.h +++ b/src/blackmisc/weather/visibilitylayer.h @@ -66,7 +66,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; diff --git a/src/blackmisc/weather/windlayer.cpp b/src/blackmisc/weather/windlayer.cpp index 9019f09fd..a0b1a5bf7 100644 --- a/src/blackmisc/weather/windlayer.cpp +++ b/src/blackmisc/weather/windlayer.cpp @@ -44,7 +44,7 @@ namespace BlackMisc } } - void CWindLayer::setPropertyByIndex(const CVariant &variant, const BlackMisc::CPropertyIndex &index) + void CWindLayer::setPropertyByIndex(const CPropertyIndex &index, const CVariant &variant) { if (index.isMyself()) { (*this) = variant.to(); return; } ColumnIndex i = index.frontCasted(); @@ -66,7 +66,7 @@ namespace BlackMisc setGustSpeed(variant.value()); break; default: - CValueObject::setPropertyByIndex(variant, index); + CValueObject::setPropertyByIndex(index, variant); break; } } diff --git a/src/blackmisc/weather/windlayer.h b/src/blackmisc/weather/windlayer.h index acef5711a..ed305b829 100644 --- a/src/blackmisc/weather/windlayer.h +++ b/src/blackmisc/weather/windlayer.h @@ -103,7 +103,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; diff --git a/tests/blackmisc/testvalueobject.cpp b/tests/blackmisc/testvalueobject.cpp index 56563ab9e..0cd5548d1 100644 --- a/tests/blackmisc/testvalueobject.cpp +++ b/tests/blackmisc/testvalueobject.cpp @@ -50,7 +50,7 @@ namespace BlackMisc /* * Property by index (setter) */ - void CTestValueObject::setPropertyByIndex(const CVariant &variant, const BlackMisc::CPropertyIndex &index) + void CTestValueObject::setPropertyByIndex(const CPropertyIndex &index, const CVariant &variant) { if (index.isMyself()) { (*this) = variant.to(); return; } ColumnIndex i = index.frontCasted(); @@ -63,7 +63,7 @@ namespace BlackMisc this->setName(variant.value()); break; default: - CValueObject::setPropertyByIndex(variant, index); + CValueObject::setPropertyByIndex(index, variant); break; } } diff --git a/tests/blackmisc/testvalueobject.h b/tests/blackmisc/testvalueobject.h index 37492d5cc..cf69615f2 100644 --- a/tests/blackmisc/testvalueobject.h +++ b/tests/blackmisc/testvalueobject.h @@ -59,7 +59,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;