refs #485, use global setup directly from sApp where possible

This commit is contained in:
Klaus Basan
2016-02-27 22:24:24 +01:00
committed by Mathew Sutcliffe
parent f03f3ef224
commit b577f9313e
8 changed files with 5 additions and 16 deletions

View File

@@ -177,7 +177,7 @@ namespace BlackCore
CUrl CIcaoDataReader::getBaseUrl() const CUrl CIcaoDataReader::getBaseUrl() const
{ {
CUrl baseUrl(this->m_setup.get().dbIcaoReaderUrl()); const CUrl baseUrl(sApp->getGlobalSetup().dbIcaoReaderUrl());
return baseUrl; return baseUrl;
} }

View File

@@ -14,7 +14,6 @@
#include "blackcore/blackcoreexport.h" #include "blackcore/blackcoreexport.h"
#include "blackcore/databasereader.h" #include "blackcore/databasereader.h"
#include "blackcore/data/globalsetup.h"
#include "blackmisc/countrylist.h" #include "blackmisc/countrylist.h"
#include "blackmisc/aviation/aircrafticaocodelist.h" #include "blackmisc/aviation/aircrafticaocodelist.h"
#include "blackmisc/aviation/airlineicaocodelist.h" #include "blackmisc/aviation/airlineicaocodelist.h"
@@ -131,8 +130,6 @@ namespace BlackCore
mutable QReadWriteLock m_lockAircraft; mutable QReadWriteLock m_lockAircraft;
mutable QReadWriteLock m_lockCountry; mutable QReadWriteLock m_lockCountry;
BlackMisc::CData<BlackCore::Data::GlobalSetup> m_setup {this}; //!< setup cache
//! Base URL //! Base URL
BlackMisc::Network::CUrl getBaseUrl() const; BlackMisc::Network::CUrl getBaseUrl() const;

View File

@@ -418,7 +418,7 @@ namespace BlackCore
CUrl CModelDataReader::getBaseUrl() const CUrl CModelDataReader::getBaseUrl() const
{ {
CUrl baseUrl(m_setup.get().dbModelReaderUrl()); const CUrl baseUrl(sApp->getGlobalSetup().dbModelReaderUrl());
return baseUrl; return baseUrl;
} }

View File

@@ -14,7 +14,6 @@
#include "blackcore/blackcoreexport.h" #include "blackcore/blackcoreexport.h"
#include "blackcore/databasereader.h" #include "blackcore/databasereader.h"
#include "blackcore/data/globalsetup.h"
#include "blackmisc/aviation/liverylist.h" #include "blackmisc/aviation/liverylist.h"
#include "blackmisc/simulation/distributorlist.h" #include "blackmisc/simulation/distributorlist.h"
#include "blackmisc/simulation/aircraftmodellist.h" #include "blackmisc/simulation/aircraftmodellist.h"
@@ -143,8 +142,6 @@ namespace BlackCore
mutable QReadWriteLock m_lockLivery; mutable QReadWriteLock m_lockLivery;
mutable QReadWriteLock m_lockModels; mutable QReadWriteLock m_lockModels;
BlackMisc::CData<BlackCore::Data::GlobalSetup> m_setup {this}; //!< setup cache
//! Base URL //! Base URL
BlackMisc::Network::CUrl getBaseUrl() const; BlackMisc::Network::CUrl getBaseUrl() const;

View File

@@ -63,7 +63,7 @@ namespace BlackCore
void CVatsimMetarReader::ps_readMetars() void CVatsimMetarReader::ps_readMetars()
{ {
this->threadAssertCheck(); this->threadAssertCheck();
QUrl url(m_setup.get().vatsimMetarsUrl()); const CUrl url(sApp->getGlobalSetup().vatsimMetarsUrl());
if (url.isEmpty()) { return; } if (url.isEmpty()) { return; }
Q_ASSERT_X(sApp, Q_FUNC_INFO, "No Application"); Q_ASSERT_X(sApp, Q_FUNC_INFO, "No Application");
sApp->getFromNetwork(url, { this, &CVatsimMetarReader::ps_decodeMetars}); sApp->getFromNetwork(url, { this, &CVatsimMetarReader::ps_decodeMetars});

View File

@@ -13,7 +13,6 @@
#define BLACKCORE_VATSIMMETARREADER_H #define BLACKCORE_VATSIMMETARREADER_H
#include "blackcoreexport.h" #include "blackcoreexport.h"
#include "blackcore/data/globalsetup.h"
#include "blackmisc/threadedreader.h" #include "blackmisc/threadedreader.h"
#include "blackmisc/weather/metardecoder.h" #include "blackmisc/weather/metardecoder.h"
#include "blackmisc/weather/metarset.h" #include "blackmisc/weather/metarset.h"
@@ -70,7 +69,6 @@ namespace BlackCore
private: private:
BlackMisc::Weather::CMetarDecoder m_metarDecoder; BlackMisc::Weather::CMetarDecoder m_metarDecoder;
BlackMisc::Weather::CMetarSet m_metars; BlackMisc::Weather::CMetarSet m_metars;
BlackMisc::CData<BlackCore::Data::GlobalSetup> m_setup {this}; //!< setup cache
}; };
} }
#endif // guard #endif // guard

View File

@@ -28,7 +28,6 @@
#include "blackgui/mainwindowaccess.h" #include "blackgui/mainwindowaccess.h"
#include "blackcore/contextallinterfaces.h" #include "blackcore/contextallinterfaces.h"
#include "blackcore/actionbind.h" #include "blackcore/actionbind.h"
#include "blackcore/data/globalsetup.h"
#include "blackmisc/network/textmessage.h" #include "blackmisc/network/textmessage.h"
#include "blackmisc/loghandler.h" #include "blackmisc/loghandler.h"
#include "blackmisc/identifiable.h" #include "blackmisc/identifiable.h"
@@ -117,7 +116,6 @@ private:
bool m_init = false; bool m_init = false;
BlackGui::CManagedStatusBar m_statusBar; BlackGui::CManagedStatusBar m_statusBar;
BlackMisc::CLogSubscriber m_logSubscriber { this, &SwiftGuiStd::ps_displayStatusMessageInGui }; BlackMisc::CLogSubscriber m_logSubscriber { this, &SwiftGuiStd::ps_displayStatusMessageInGui };
BlackMisc::CData<BlackCore::Data::GlobalSetup> m_setup {this}; //!< setup cache
// contexts // contexts
bool m_coreAvailable = false; bool m_coreAvailable = false;

View File

@@ -9,8 +9,7 @@
#include "swiftguistd.h" #include "swiftguistd.h"
#include "ui_swiftguistd.h" #include "ui_swiftguistd.h"
#include "blackmisc/datacache.h" #include "blackcore/application.h"
#include "blackmisc/settingscache.h"
#include "blackgui/stylesheetutility.h" #include "blackgui/stylesheetutility.h"
#include "blackgui/components/settingscomponent.h" #include "blackgui/components/settingscomponent.h"
#include "blackgui/components/logcomponent.h" #include "blackgui/components/logcomponent.h"
@@ -131,7 +130,7 @@ void SwiftGuiStd::ps_onMenuClicked()
} }
else if (sender == this->ui->menu_InternalsSetup) else if (sender == this->ui->menu_InternalsSetup)
{ {
QString setup(this->m_setup.get().convertToQString("\n", true)); QString setup(sApp->getGlobalSetup().convertToQString("\n", true));
this->ui->comp_MainInfoArea->getLogComponent()->appendPlainTextToConsole(setup); this->ui->comp_MainInfoArea->getLogComponent()->appendPlainTextToConsole(setup);
this->displayConsole(); this->displayConsole();
} }