Background updater can be const, only needed "readonly" for UI

This commit is contained in:
Klaus Basan
2017-07-03 19:57:10 +02:00
committed by Mathew Sutcliffe
parent 6a17465633
commit a1e16ea162
5 changed files with 6 additions and 5 deletions

View File

@@ -169,6 +169,7 @@ namespace BlackCore
const QSet<CSimulatorInfo> simSet = sims.asSingleSimulatorSet(); const QSet<CSimulatorInfo> simSet = sims.asSingleSimulatorSet();
for (const CSimulatorInfo &singleInfo : simSet) for (const CSimulatorInfo &singleInfo : simSet)
{ {
if (this->isShuttingDown()) { return; }
CAircraftModelList simModels = cache.getSynchronizedCachedModels(singleInfo); CAircraftModelList simModels = cache.getSynchronizedCachedModels(singleInfo);
if (simModels.isEmpty()) { continue; } if (simModels.isEmpty()) { continue; }
const CAircraftModelList dbModelsForSim = dbModels.matchesSimulator(singleInfo); const CAircraftModelList dbModelsForSim = dbModels.matchesSimulator(singleInfo);

View File

@@ -28,7 +28,7 @@ namespace BlackGui
CDataSettingsComponent::~CDataSettingsComponent() CDataSettingsComponent::~CDataSettingsComponent()
{ } { }
void CDataSettingsComponent::setBackgroundUpdater(CBackgroundDataUpdater *updater) void CDataSettingsComponent::setBackgroundUpdater(const CBackgroundDataUpdater *updater)
{ {
ui->comp_ModelSettings->setBackgroundUpdater(updater); ui->comp_ModelSettings->setBackgroundUpdater(updater);
} }

View File

@@ -40,7 +40,7 @@ namespace BlackGui
virtual ~CDataSettingsComponent(); virtual ~CDataSettingsComponent();
//! Background updater //! Background updater
void setBackgroundUpdater(BlackCore::Db::CBackgroundDataUpdater *updater); void setBackgroundUpdater(const BlackCore::Db::CBackgroundDataUpdater *updater);
private: private:
QScopedPointer<Ui::CDataSettingsComponent> ui; QScopedPointer<Ui::CDataSettingsComponent> ui;

View File

@@ -49,7 +49,7 @@ namespace BlackGui
return ok ? secs : -1; return ok ? secs : -1;
} }
void CSettingsModelComponent::setBackgroundUpdater(BlackCore::Db::CBackgroundDataUpdater *updater) void CSettingsModelComponent::setBackgroundUpdater(const BlackCore::Db::CBackgroundDataUpdater *updater)
{ {
m_updater = updater; m_updater = updater;
} }

View File

@@ -39,12 +39,12 @@ namespace BlackGui
int getBackgroundUpdaterIntervallSecs() const; int getBackgroundUpdaterIntervallSecs() const;
//! Updater (the updater this setting is for) //! Updater (the updater this setting is for)
void setBackgroundUpdater(BlackCore::Db::CBackgroundDataUpdater *updater); void setBackgroundUpdater(const BlackCore::Db::CBackgroundDataUpdater *updater);
private: private:
QScopedPointer<Ui::CSettingsModelComponent> ui; QScopedPointer<Ui::CSettingsModelComponent> ui;
BlackMisc::CSetting<BlackGui::Settings::TBackgroundConsolidation> m_consolidationSetting { this, &CSettingsModelComponent::cacheChanged }; //!< consolidation time BlackMisc::CSetting<BlackGui::Settings::TBackgroundConsolidation> m_consolidationSetting { this, &CSettingsModelComponent::cacheChanged }; //!< consolidation time
BlackCore::Db::CBackgroundDataUpdater *m_updater = nullptr; //!< externally (i.e. other component) provided existing updater const BlackCore::Db::CBackgroundDataUpdater *m_updater = nullptr; //!< externally (i.e. other component) provided existing updater
//! Consolidation time entered //! Consolidation time entered
void consolidationEntered(); void consolidationEntered();