From 31a824540a806ea3f5ec054e2d08a49330132c08 Mon Sep 17 00:00:00 2001 From: Klaus Basan Date: Sat, 2 Apr 2016 00:42:18 +0200 Subject: [PATCH] refs #632, fixed CAircraftCfgEntries ColumnIndex functions --- .../fscommon/aircraftcfgentries.cpp | 71 ++++++++----------- .../simulation/fscommon/aircraftcfgentries.h | 8 ++- 2 files changed, 36 insertions(+), 43 deletions(-) diff --git a/src/blackmisc/simulation/fscommon/aircraftcfgentries.cpp b/src/blackmisc/simulation/fscommon/aircraftcfgentries.cpp index 2a00c0f59..75bfdb4f9 100644 --- a/src/blackmisc/simulation/fscommon/aircraftcfgentries.cpp +++ b/src/blackmisc/simulation/fscommon/aircraftcfgentries.cpp @@ -157,24 +157,21 @@ namespace BlackMisc ColumnIndex i = index.frontCasted(); switch (i) { - case IndexFileName: - return CVariant::from(this->m_fileName); - case IndexTitle: - return CVariant::from(this->m_title); - case IndexAtcType: - return CVariant::from(this->m_atcType); - case IndexAtcModel: - return CVariant::from(this->m_atcModel); - case IndexParkingCode: - return CVariant::from(this->m_atcParkingCode); - case IndexEntryIndex: - return CVariant::from(this->m_index); - case IndexTexture: - return CVariant::from(this->m_texture); - case IndexDescription: - return CVariant::from(this->m_description); - default: - return CValueObject::propertyByIndex(index); + case IndexEntryIndex: return CVariant::from(this->m_index); + case IndexFileName: return CVariant::from(this->m_fileName); + case IndexTitle: return CVariant::from(this->m_title); + case IndexAirline: return CVariant::from(this->m_atcAirline); + case IndexAtcType: return CVariant::from(this->m_atcType); + case IndexAtcModel: return CVariant::from(this->m_atcModel); + case IndexParkingCode: return CVariant::from(this->m_atcParkingCode); + case IndexDescription: return CVariant::from(this->m_description); + case IndexUiType: return CVariant::from(this->m_uiType); + case IndexUiManufacturer: return CVariant::from(this->m_uiManufacturer); + case IndexTexture: return CVariant::from(this->m_texture); + case IndexSimulatorName: return CVariant::from(this->m_simName); + case IndexCreatedBy: return CVariant::from(this->m_createdBy); + case IndexRotorcraft: return CVariant::from(this->m_rotorcraft); + default: return CValueObject::propertyByIndex(index); } } @@ -185,30 +182,20 @@ namespace BlackMisc ColumnIndex i = index.frontCasted(); switch (i) { - case IndexAtcModel: - this->setAtcModel(variant.toQString()); - break; - case IndexAtcType: - this->setAtcType(variant.toQString()); - break; - case IndexEntryIndex: - this->setIndex(variant.toInt()); - break; - case IndexFileName: - this->setFileName(variant.toQString()); - break; - case IndexParkingCode: - this->setAtcParkingCode(variant.toQString()); - break; - case IndexTitle: - this->setTitle(variant.toQString()); - break; - case IndexDescription: - this->setDescription(variant.toQString()); - break; - case IndexTexture: - this->setTexture(variant.toQString()); - break; + case IndexEntryIndex: this->setIndex(variant.toInt()); break; + case IndexFileName: this->setFileName(variant.toQString()); break; + case IndexTitle: this->setTitle(variant.toQString()); break; + case IndexAirline: this->setTitle(this->m_atcAirline); break; + case IndexAtcType: this->setAtcType(variant.toQString()); break; + case IndexAtcModel: this->setAtcModel(variant.toQString()); break; + case IndexParkingCode: this->setAtcParkingCode(variant.toQString()); break; + case IndexDescription: this->setDescription(variant.toQString()); break; + case IndexUiType: this->setUiType(variant.toQString()); break; + case IndexUiManufacturer: this->setUiManufacturer(variant.toQString()); break; + case IndexTexture: this->setTexture(variant.toQString()); break; + case IndexSimulatorName: this->setSimName(variant.toQString()); break; + case IndexCreatedBy: this->setCreatedBy(variant.toQString()); break; + case IndexRotorcraft: this->setRotorcraft(variant.toBool()); break; default: CValueObject::setPropertyByIndex(variant, index); break; diff --git a/src/blackmisc/simulation/fscommon/aircraftcfgentries.h b/src/blackmisc/simulation/fscommon/aircraftcfgentries.h index bbc1ff39d..c0708fa66 100644 --- a/src/blackmisc/simulation/fscommon/aircraftcfgentries.h +++ b/src/blackmisc/simulation/fscommon/aircraftcfgentries.h @@ -39,11 +39,17 @@ namespace BlackMisc IndexEntryIndex = BlackMisc::CPropertyIndex::GlobalIndexCAircraftCfgEntries, IndexFileName, IndexTitle, + IndexAirline, IndexAtcType, IndexAtcModel, IndexParkingCode, IndexDescription, - IndexTexture + IndexUiType, + IndexUiManufacturer, + IndexTexture, + IndexSimulatorName, + IndexCreatedBy, + IndexRotorcraft }; //! Default constructor