diff --git a/src/blackgui/components/dbmappingcomponent.cpp b/src/blackgui/components/dbmappingcomponent.cpp index ea098eb98..fb80cc30a 100644 --- a/src/blackgui/components/dbmappingcomponent.cpp +++ b/src/blackgui/components/dbmappingcomponent.cpp @@ -141,7 +141,7 @@ namespace BlackGui CDbMappingComponent::~CDbMappingComponent() { - gracefulShutdown(); + this->gracefulShutdown(); } void CDbMappingComponent::initVPilotLoading() @@ -197,22 +197,10 @@ namespace BlackGui const QObject *sender = QObject::sender(); // check if we have an explicit sender - if (sender == ui->tvp_AircraftModelsForVPilot) - { - return ui->tvp_AircraftModelsForVPilot->at(index); - } - else if (sender == ui->comp_OwnAircraftModels->view()) - { - return ui->comp_OwnAircraftModels->view()->at(index); - } - else if (sender == ui->comp_StashAircraft || sender == ui->comp_StashAircraft->view()) - { - return ui->comp_StashAircraft->view()->at(index); - } - else if (sender == ui->comp_OwnModelSet->view()) - { - return ui->comp_OwnModelSet->view()->at(index); - } + if (sender == ui->tvp_AircraftModelsForVPilot) { return ui->tvp_AircraftModelsForVPilot->at(index); } + if (sender == ui->comp_OwnAircraftModels->view()) { return ui->comp_OwnAircraftModels->view()->at(index); } + if (sender == ui->comp_StashAircraft || sender == ui->comp_StashAircraft->view()) { return ui->comp_StashAircraft->view()->at(index); } + if (sender == ui->comp_OwnModelSet->view()) { return ui->comp_OwnModelSet->view()->at(index); } // no sender, use current tab const CAircraftModelView *v = this->currentModelView(); @@ -245,9 +233,10 @@ namespace BlackGui const TabIndex tab = currentTabIndex(); switch (tab) { - case TabOwnModels: return ui->comp_OwnAircraftModels->view(); - case TabVPilot: return ui->tvp_AircraftModelsForVPilot; - case TabStash: return ui->comp_StashAircraft->view(); + case TabOwnModels: return ui->comp_OwnAircraftModels->view(); + case TabVPilot: return ui->tvp_AircraftModelsForVPilot; + case TabWorkbench: return ui->comp_ModelWorkbench->view(); + case TabStash: return ui->comp_StashAircraft->view(); case TabOwnModelSet: return ui->comp_OwnModelSet->view(); default: return nullptr; } diff --git a/src/blackgui/components/dbmodelcomponent.h b/src/blackgui/components/dbmodelcomponent.h index 079957271..e53bc6e80 100644 --- a/src/blackgui/components/dbmodelcomponent.h +++ b/src/blackgui/components/dbmodelcomponent.h @@ -24,8 +24,6 @@ #include #include -class QWidget; - namespace Ui { class CDbModelComponent; } namespace BlackGui { diff --git a/src/blackgui/components/dbownmodelscomponent.cpp b/src/blackgui/components/dbownmodelscomponent.cpp index 31d8b9648..ceb573627 100644 --- a/src/blackgui/components/dbownmodelscomponent.cpp +++ b/src/blackgui/components/dbownmodelscomponent.cpp @@ -7,8 +7,6 @@ * contained in the LICENSE file. */ -#include "blackcore/webdataservices.h" -#include "blackcore/db/databaseutils.h" #include "blackgui/components/dbownmodelscomponent.h" #include "blackgui/components/simulatorselector.h" #include "blackgui/guiapplication.h" @@ -16,6 +14,8 @@ #include "blackgui/menus/menuaction.h" #include "blackgui/models/aircraftmodellistmodel.h" #include "blackgui/views/aircraftmodelview.h" +#include "blackcore/webdataservices.h" +#include "blackcore/db/databaseutils.h" #include "blackmisc/icons.h" #include "blackmisc/logmessage.h" #include "blackmisc/statusmessage.h" diff --git a/src/blackgui/components/dbownmodelscomponent.h b/src/blackgui/components/dbownmodelscomponent.h index c885ddbc5..5fc9e050c 100644 --- a/src/blackgui/components/dbownmodelscomponent.h +++ b/src/blackgui/components/dbownmodelscomponent.h @@ -15,7 +15,6 @@ #include "blackgui/menus/menudelegate.h" #include "blackgui/overlaymessagesframe.h" #include "blackmisc/datacache.h" -#include "blackmisc/simulation/aircraftmodel.h" #include "blackmisc/simulation/aircraftmodellist.h" #include "blackmisc/simulation/aircraftmodelloader.h" #include "blackmisc/simulation/aircraftmodelinterfaces.h" diff --git a/src/blackgui/components/installfsxterrainprobecomponent.h b/src/blackgui/components/installfsxterrainprobecomponent.h index 75c6ad58f..ad959438e 100644 --- a/src/blackgui/components/installfsxterrainprobecomponent.h +++ b/src/blackgui/components/installfsxterrainprobecomponent.h @@ -27,6 +27,7 @@ namespace BlackGui Q_OBJECT public: + //! Constructor explicit CInstallFsxTerrainProbeComponent(QWidget *parent = nullptr); //! Destructors diff --git a/src/blackgui/components/usercomponent.cpp b/src/blackgui/components/usercomponent.cpp index 22aca29fe..76ea5ca4d 100644 --- a/src/blackgui/components/usercomponent.cpp +++ b/src/blackgui/components/usercomponent.cpp @@ -38,11 +38,11 @@ namespace BlackGui this->setCurrentIndex(0); this->tabBar()->setExpanding(false); this->tabBar()->setUsesScrollButtons(true); - connect(ui->tvp_AllUsers, &CUserView::modelDataChangedDigest, this, &CUserComponent::ps_onCountChanged); - connect(ui->tvp_Clients, &CClientView::modelDataChangedDigest, this, &CUserComponent::ps_onCountChanged); - connect(sGui->getIContextNetwork(), &IContextNetwork::connectionStatusChanged, this, &CUserComponent::ps_connectionStatusChanged); + connect(ui->tvp_AllUsers, &CUserView::modelDataChangedDigest, this, &CUserComponent::onCountChanged); + connect(ui->tvp_Clients, &CClientView::modelDataChangedDigest, this, &CUserComponent::onCountChanged); + connect(sGui->getIContextNetwork(), &IContextNetwork::connectionStatusChanged, this, &CUserComponent::onConnectionStatusChanged); connect(&m_updateTimer, &QTimer::timeout, this, &CUserComponent::update); - this->ps_settingsChanged(); + this->onSettingsChanged(); } CUserComponent::~CUserComponent() @@ -81,7 +81,7 @@ namespace BlackGui } } - void CUserComponent::ps_onCountChanged(int count, bool withFilter) + void CUserComponent::onCountChanged(int count, bool withFilter) { Q_UNUSED(count); Q_UNUSED(withFilter); @@ -95,26 +95,26 @@ namespace BlackGui this->tabBar()->setTabText(ic, c); } - void CUserComponent::ps_connectionStatusChanged(INetwork::ConnectionStatus from, INetwork::ConnectionStatus to) + void CUserComponent::onConnectionStatusChanged(INetwork::ConnectionStatus from, INetwork::ConnectionStatus to) { Q_UNUSED(from); if (INetwork::isDisconnectedStatus(to)) { ui->tvp_AllUsers->clear(); ui->tvp_Clients->clear(); - this->m_updateTimer.stop(); + m_updateTimer.stop(); } else if (INetwork::isConnectedStatus(to)) { - this->m_updateTimer.start(); + m_updateTimer.start(); } } - void CUserComponent::ps_settingsChanged() + void CUserComponent::onSettingsChanged() { - const CViewUpdateSettings settings = this->m_settings.get(); + const CViewUpdateSettings settings = m_settings.get(); const int ms = settings.getAtcUpdateTime().toMs(); - this->m_updateTimer.setInterval(ms); + m_updateTimer.setInterval(ms); } } // namespace } // namespace diff --git a/src/blackgui/components/usercomponent.h b/src/blackgui/components/usercomponent.h index 94eafc99a..004f7560c 100644 --- a/src/blackgui/components/usercomponent.h +++ b/src/blackgui/components/usercomponent.h @@ -23,8 +23,6 @@ #include #include -class QWidget; - namespace Ui { class CUserComponent; } namespace BlackGui { @@ -42,7 +40,7 @@ namespace BlackGui explicit CUserComponent(QWidget *parent = nullptr); //! Destructor - ~CUserComponent(); + virtual ~CUserComponent(); //! Number of clients int countClients() const; @@ -54,20 +52,19 @@ namespace BlackGui //! Update users void update(); - private slots: + private: //! Number of elements changed - void ps_onCountChanged(int count, bool withFilter); + void onCountChanged(int count, bool withFilter); //! Connection status - void ps_connectionStatusChanged(BlackCore::INetwork::ConnectionStatus from, BlackCore::INetwork::ConnectionStatus to); + void onConnectionStatusChanged(BlackCore::INetwork::ConnectionStatus from, BlackCore::INetwork::ConnectionStatus to); //! Settings have been changed - void ps_settingsChanged(); + void onSettingsChanged(); - private: QScopedPointer ui; QTimer m_updateTimer; - BlackMisc::CSettingReadOnly m_settings { this, &CUserComponent::ps_settingsChanged }; + BlackMisc::CSettingReadOnly m_settings { this, &CUserComponent::onSettingsChanged }; }; } } diff --git a/src/blackgui/views/aircraftmodelview.cpp b/src/blackgui/views/aircraftmodelview.cpp index 81fed5a9c..a6b39c90b 100644 --- a/src/blackgui/views/aircraftmodelview.cpp +++ b/src/blackgui/views/aircraftmodelview.cpp @@ -392,7 +392,7 @@ namespace BlackGui if (!m_menus.testFlag(MenuCanStashModels)) { return; } if (!this->hasSelection()) { return; } const CAircraftModelList models(this->selectedObjects()); - emit requestStash(models); + emit this->requestStash(models); if (m_stashingClearsSelection) { this->clearSelection(); diff --git a/src/blackmisc/settingscache.h b/src/blackmisc/settingscache.h index d5523fa14..f4ccfe37d 100644 --- a/src/blackmisc/settingscache.h +++ b/src/blackmisc/settingscache.h @@ -38,17 +38,17 @@ namespace BlackMisc static const QString &persistentStore(); //! Save settings to disk. - BlackMisc::CStatusMessage saveToStore(const QString &keyPrefix = {}); + CStatusMessage saveToStore(const QString &keyPrefix = {}); //! Save settings to disk. - BlackMisc::CStatusMessage saveToStore(const QStringList &keys); + CStatusMessage saveToStore(const QStringList &keys); //! Connects signal CValueCache::valuesSaveRequested to a private slot that saves the values. //! In a dbus distributed scenario, only call this method in the core process. void enableLocalSave(); //! Load settings from disk. - BlackMisc::CStatusMessage loadFromStore(); + CStatusMessage loadFromStore(); //! Return the filename where the value with the given key may be stored. static QString filenameForKey(const QString &key);