diff --git a/src/blackgui/components/firstmodelsetcomponent.cpp b/src/blackgui/components/firstmodelsetcomponent.cpp index 77e260a2d..27c7946e7 100644 --- a/src/blackgui/components/firstmodelsetcomponent.cpp +++ b/src/blackgui/components/firstmodelsetcomponent.cpp @@ -16,6 +16,7 @@ #include using namespace BlackMisc::Simulation; +using namespace BlackMisc::Simulation::Settings; namespace BlackGui { @@ -96,7 +97,7 @@ namespace BlackGui return this->modelSetComponent()->modelSetLoader(); } - const Settings::CMultiSimulatorSettings &CFirstModelSetComponent::simulatorSettings() const + const CMultiSimulatorSettings &CFirstModelSetComponent::simulatorSettings() const { return this->modelLoader()->multiSimulatorSettings(); } diff --git a/src/blackgui/components/settingssimulatorcomponent.cpp b/src/blackgui/components/settingssimulatorcomponent.cpp index c402bbc73..7b60d5c4f 100644 --- a/src/blackgui/components/settingssimulatorcomponent.cpp +++ b/src/blackgui/components/settingssimulatorcomponent.cpp @@ -69,19 +69,19 @@ namespace BlackGui ui->le_MaxDistance->setValidator(new QIntValidator(ui->le_MaxDistance)); // connects - connect(sGui->getIContextSimulator(), &IContextSimulator::simulatorPluginChanged, this, &CSettingsSimulatorComponent::ps_simulatorPluginChanged); - connect(ui->pluginSelector_EnabledSimulators, &CPluginSelector::pluginStateChanged, this, &CSettingsSimulatorComponent::ps_pluginStateChanged); - connect(ui->pluginSelector_EnabledSimulators, &CPluginSelector::pluginDetailsRequested, this, &CSettingsSimulatorComponent::ps_showPluginDetails); - connect(ui->pluginSelector_EnabledSimulators, &CPluginSelector::pluginConfigRequested, this, &CSettingsSimulatorComponent::ps_showPluginConfig); - connect(ui->pb_ApplyMaxAircraft, &QCheckBox::pressed, this, &CSettingsSimulatorComponent::ps_onApplyMaxRenderedAircraft); - connect(ui->pb_ApplyTimeSync, &QCheckBox::pressed, this, &CSettingsSimulatorComponent::ps_onApplyTimeSync); - connect(ui->pb_ApplyMaxDistance, &QCheckBox::pressed, this, &CSettingsSimulatorComponent::ps_onApplyMaxRenderedDistance); - connect(ui->pb_ClearRestrictedRendering, &QCheckBox::pressed, this, &CSettingsSimulatorComponent::ps_clearRestricedRendering); - connect(ui->pb_DisableRendering, &QCheckBox::pressed, this, &CSettingsSimulatorComponent::ps_onApplyDisableRendering); - connect(ui->le_MaxAircraft, &QLineEdit::editingFinished, this, &CSettingsSimulatorComponent::ps_onApplyMaxRenderedAircraft); - connect(ui->le_MaxDistance, &QLineEdit::editingFinished, this, &CSettingsSimulatorComponent::ps_onApplyMaxRenderedDistance); - connect(ui->le_MaxAircraft, &QLineEdit::returnPressed, this, &CSettingsSimulatorComponent::ps_onApplyMaxRenderedAircraft); - connect(ui->le_MaxDistance, &QLineEdit::returnPressed, this, &CSettingsSimulatorComponent::ps_onApplyMaxRenderedDistance); + connect(sGui->getIContextSimulator(), &IContextSimulator::simulatorPluginChanged, this, &CSettingsSimulatorComponent::simulatorPluginChanged); + connect(ui->pluginSelector_EnabledSimulators, &CPluginSelector::pluginStateChanged, this, &CSettingsSimulatorComponent::pluginStateChanged); + connect(ui->pluginSelector_EnabledSimulators, &CPluginSelector::pluginDetailsRequested, this, &CSettingsSimulatorComponent::showPluginDetails); + connect(ui->pluginSelector_EnabledSimulators, &CPluginSelector::pluginConfigRequested, this, &CSettingsSimulatorComponent::showPluginConfig); + connect(ui->pb_ApplyMaxAircraft, &QCheckBox::pressed, this, &CSettingsSimulatorComponent::onApplyMaxRenderedAircraft); + connect(ui->pb_ApplyTimeSync, &QCheckBox::pressed, this, &CSettingsSimulatorComponent::onApplyTimeSync); + connect(ui->pb_ApplyMaxDistance, &QCheckBox::pressed, this, &CSettingsSimulatorComponent::onApplyMaxRenderedDistance); + connect(ui->pb_ClearRestrictedRendering, &QCheckBox::pressed, this, &CSettingsSimulatorComponent::clearRestricedRendering); + connect(ui->pb_DisableRendering, &QCheckBox::pressed, this, &CSettingsSimulatorComponent::onApplyDisableRendering); + connect(ui->le_MaxAircraft, &QLineEdit::editingFinished, this, &CSettingsSimulatorComponent::onApplyMaxRenderedAircraft); + connect(ui->le_MaxDistance, &QLineEdit::editingFinished, this, &CSettingsSimulatorComponent::onApplyMaxRenderedDistance); + connect(ui->le_MaxAircraft, &QLineEdit::returnPressed, this, &CSettingsSimulatorComponent::onApplyMaxRenderedAircraft); + connect(ui->le_MaxDistance, &QLineEdit::returnPressed, this, &CSettingsSimulatorComponent::onApplyMaxRenderedDistance); // list all available simulators for (const auto &p : getAvailablePlugins()) @@ -91,10 +91,10 @@ namespace BlackGui } // config - ps_reloadPluginConfig(); + reloadPluginConfig(); // init - ps_simulatorPluginChanged(sGui->getIContextSimulator()->getSimulatorPluginInfo()); + simulatorPluginChanged(sGui->getIContextSimulator()->getSimulatorPluginInfo()); } CSettingsSimulatorComponent::~CSettingsSimulatorComponent() @@ -145,7 +145,7 @@ namespace BlackGui return sGui->getIContextSimulator()->getAvailableSimulatorPlugins(); } - void CSettingsSimulatorComponent::ps_pluginStateChanged(const QString &identifier, bool enabled) + void CSettingsSimulatorComponent::pluginStateChanged(const QString &identifier, bool enabled) { Q_ASSERT(sGui && sGui->getIContextSimulator()); @@ -178,7 +178,7 @@ namespace BlackGui // changing of GUI state will be done via received signal } - void CSettingsSimulatorComponent::ps_onApplyMaxRenderedAircraft() + void CSettingsSimulatorComponent::onApplyMaxRenderedAircraft() { // get initial aircraft to render CInterpolationAndRenderingSetup setup = sGui->getIContextSimulator()->getInterpolationAndRenderingSetup(); @@ -205,7 +205,7 @@ namespace BlackGui this->setGuiValues(); } - void CSettingsSimulatorComponent::ps_onApplyMaxRenderedDistance() + void CSettingsSimulatorComponent::onApplyMaxRenderedDistance() { // get initial aircraft to render CInterpolationAndRenderingSetup setup = sGui->getIContextSimulator()->getInterpolationAndRenderingSetup(); @@ -229,7 +229,7 @@ namespace BlackGui } } - void CSettingsSimulatorComponent::ps_onApplyDisableRendering() + void CSettingsSimulatorComponent::onApplyDisableRendering() { CInterpolationAndRenderingSetup setup = sGui->getIContextSimulator()->getInterpolationAndRenderingSetup(); setup.disableRendering(); @@ -237,7 +237,7 @@ namespace BlackGui this->setGuiValues(); } - void CSettingsSimulatorComponent::ps_onApplyTimeSync() + void CSettingsSimulatorComponent::onApplyTimeSync() { const bool timeSync = ui->cb_TimeSync->isChecked(); const QString os = ui->le_TimeSyncOffset->text(); @@ -256,7 +256,7 @@ namespace BlackGui } } - void CSettingsSimulatorComponent::ps_clearRestricedRendering() + void CSettingsSimulatorComponent::clearRestricedRendering() { CInterpolationAndRenderingSetup setup; setup.clearAllRenderingRestrictions(); @@ -264,7 +264,7 @@ namespace BlackGui this->setGuiValues(); } - void CSettingsSimulatorComponent::ps_simulatorPluginChanged(const CSimulatorPluginInfo &info) + void CSettingsSimulatorComponent::simulatorPluginChanged(const CSimulatorPluginInfo &info) { // I intentionally do not set the selected plugin combobox here // as this would cause undesired roundtrips @@ -283,7 +283,7 @@ namespace BlackGui this->setGuiValues(); } - void CSettingsSimulatorComponent::ps_showPluginDetails(const QString &identifier) + void CSettingsSimulatorComponent::showPluginDetails(const QString &identifier) { const CSimulatorPluginInfoList simDrivers(getAvailablePlugins()); const CSimulatorPluginInfo selected = simDrivers.findByIdentifier(identifier); @@ -303,7 +303,7 @@ namespace BlackGui w->show(); } - void CSettingsSimulatorComponent::ps_showPluginConfig(const QString &identifier) + void CSettingsSimulatorComponent::showPluginConfig(const QString &identifier) { const CSimulatorPluginInfoList simDrivers(getAvailablePlugins()); const CSimulatorPluginInfo selected = simDrivers.findByIdentifier(identifier); @@ -321,7 +321,7 @@ namespace BlackGui window->show(); } - void CSettingsSimulatorComponent::ps_reloadPluginConfig() + void CSettingsSimulatorComponent::reloadPluginConfig() { // list all available simulators const auto enabledSimulators = m_enabledSimulators.getThreadLocal(); diff --git a/src/blackgui/components/settingssimulatorcomponent.h b/src/blackgui/components/settingssimulatorcomponent.h index 85502c146..7fbf397ba 100644 --- a/src/blackgui/components/settingssimulatorcomponent.h +++ b/src/blackgui/components/settingssimulatorcomponent.h @@ -43,38 +43,37 @@ namespace BlackGui //! Destructor virtual ~CSettingsSimulatorComponent(); - private slots: + private: //! Driver plugin enabled/disabled - void ps_pluginStateChanged(const QString &identifier, bool enabled); + void pluginStateChanged(const QString &identifier, bool enabled); //! Apply max.aircraft - void ps_onApplyMaxRenderedAircraft(); + void onApplyMaxRenderedAircraft(); //! Apply max.distance - void ps_onApplyMaxRenderedDistance(); + void onApplyMaxRenderedDistance(); //! Apply disable rendering - void ps_onApplyDisableRendering(); + void onApplyDisableRendering(); //! Apply time sync - void ps_onApplyTimeSync(); + void onApplyTimeSync(); //! Clear restricted rendering - void ps_clearRestricedRendering(); + void clearRestricedRendering(); //! Simulator plugin changed - void ps_simulatorPluginChanged(const BlackMisc::Simulation::CSimulatorPluginInfo &info); + void simulatorPluginChanged(const BlackMisc::Simulation::CSimulatorPluginInfo &info); //! Open plugin details window - void ps_showPluginDetails(const QString &identifier); + void showPluginDetails(const QString &identifier); //! Show plugin config - void ps_showPluginConfig(const QString &identifier); + void showPluginConfig(const QString &identifier); //! Select/deselect enabled/disabled plugins - void ps_reloadPluginConfig(); + void reloadPluginConfig(); - private: //! Set the GUI values void setGuiValues(); @@ -84,7 +83,7 @@ namespace BlackGui QScopedPointer ui; //!< UI bool m_pluginLoaded = false; //!< plugin loaded? BlackCore::CPluginManagerSimulator* m_plugins = nullptr; - BlackMisc::CSetting m_enabledSimulators { this, &CSettingsSimulatorComponent::ps_reloadPluginConfig }; + BlackMisc::CSetting m_enabledSimulators { this, &CSettingsSimulatorComponent::reloadPluginConfig }; }; } } // namespace diff --git a/src/blackmisc/simulation/aircraftmodelloader.h b/src/blackmisc/simulation/aircraftmodelloader.h index eda0e8cbc..16d314127 100644 --- a/src/blackmisc/simulation/aircraftmodelloader.h +++ b/src/blackmisc/simulation/aircraftmodelloader.h @@ -39,10 +39,10 @@ namespace BlackMisc */ class BLACKMISC_EXPORT IAircraftModelLoader : public QObject, - public BlackMisc::Simulation::IModelsSetable, - public BlackMisc::Simulation::IModelsUpdatable, - public BlackMisc::Simulation::IModelsPerSimulatorSetable, - public BlackMisc::Simulation::IModelsPerSimulatorUpdatable + public IModelsSetable, + public IModelsUpdatable, + public IModelsPerSimulatorSetable, + public IModelsPerSimulatorUpdatable { Q_OBJECT Q_INTERFACES(BlackMisc::Simulation::IModelsSetable) diff --git a/src/blackmisc/simulation/fscommon/aircraftcfgparser.h b/src/blackmisc/simulation/fscommon/aircraftcfgparser.h index 3df09bbf1..f8ef23092 100644 --- a/src/blackmisc/simulation/fscommon/aircraftcfgparser.h +++ b/src/blackmisc/simulation/fscommon/aircraftcfgparser.h @@ -35,7 +35,7 @@ namespace BlackMisc namespace FsCommon { //! Utility, parsing the aircraft.cfg files - class BLACKMISC_EXPORT CAircraftCfgParser : public BlackMisc::Simulation::IAircraftModelLoader + class BLACKMISC_EXPORT CAircraftCfgParser : public IAircraftModelLoader { Q_OBJECT diff --git a/src/blackmisc/simulation/xplane/aircraftmodelloaderxplane.cpp b/src/blackmisc/simulation/xplane/aircraftmodelloaderxplane.cpp index 394db1f93..a30b6eae1 100644 --- a/src/blackmisc/simulation/xplane/aircraftmodelloaderxplane.cpp +++ b/src/blackmisc/simulation/xplane/aircraftmodelloaderxplane.cpp @@ -93,25 +93,25 @@ namespace BlackMisc { if (model.getDistributor().hasDescription() && !model.getName().contains(model.getDistributor().getDescription())) { - return "[ACF] " % model.getName() % " by " % model.getDistributor().getDescription(); + return QStringLiteral("[ACF] ") % model.getName() % QStringLiteral(" by ") % model.getDistributor().getDescription(); } else { - return "[ACF] " % model.getName(); + return QStringLiteral("[ACF] ") % model.getName(); } } else if (model.hasAircraftDesignator()) { if (model.getDistributor().hasDescription()) { - return "[ACF] " % model.getAircraftIcaoCodeDesignator() % " by " % model.getDistributor().getDescription(); + return QStringLiteral("[ACF] ") % model.getAircraftIcaoCodeDesignator() % QStringLiteral(" by ") % model.getDistributor().getDescription(); } else { - return "[ACF] " % model.getAircraftIcaoCodeDesignator(); + return QStringLiteral("[ACF] ") % model.getAircraftIcaoCodeDesignator(); } } - return "[ACF]"; + return QStringLiteral("[ACF]"); } CAircraftModelLoaderXPlane::CAircraftModelLoaderXPlane() : IAircraftModelLoader(CSimulatorInfo::XPLANE) diff --git a/src/blackmisc/simulation/xplane/aircraftmodelloaderxplane.h b/src/blackmisc/simulation/xplane/aircraftmodelloaderxplane.h index efea63788..1053b5ce8 100644 --- a/src/blackmisc/simulation/xplane/aircraftmodelloaderxplane.h +++ b/src/blackmisc/simulation/xplane/aircraftmodelloaderxplane.h @@ -35,7 +35,7 @@ namespace BlackMisc /*! * XPlane aircraft model loader */ - class BLACKMISC_EXPORT CAircraftModelLoaderXPlane : public BlackMisc::Simulation::IAircraftModelLoader + class BLACKMISC_EXPORT CAircraftModelLoaderXPlane : public IAircraftModelLoader { Q_OBJECT @@ -74,10 +74,10 @@ namespace BlackMisc QString objectName; //!< Complete basename of the object file QString textureName; //!< Complete basename of the texture file. Can be empty. - QString filePath; //!< object filePath - QString icao; //!< Icao type of this model - QString airline; //!< Airline identifier. Can be empty. - QString livery; //!< Livery identifier. Can be empty. + QString filePath; //!< object filePath + QString icao; //!< Icao type of this model + QString airline; //!< Airline identifier. Can be empty. + QString livery; //!< Livery identifier. Can be empty. }; struct CSLPackage