aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xbmc/Application.cpp5
-rw-r--r--xbmc/Application.h2
-rw-r--r--xbmc/ServiceBroker.cpp16
-rw-r--r--xbmc/ServiceBroker.h5
-rw-r--r--xbmc/ServiceManager.cpp1
-rw-r--r--xbmc/settings/SettingsComponent.cpp7
-rw-r--r--xbmc/settings/SettingsComponent.h4
-rw-r--r--xbmc/test/TestBasicEnvironment.cpp6
-rw-r--r--xbmc/test/TestBasicEnvironment.h1
9 files changed, 15 insertions, 32 deletions
diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp
index 129d020ea2..79ea98ffe1 100644
--- a/xbmc/Application.cpp
+++ b/xbmc/Application.cpp
@@ -247,8 +247,6 @@ CApplication::~CApplication(void)
delete m_pInertialScrollingHandler;
m_actionListeners.clear();
-
- CServiceBroker::UnregisterSettings();
}
bool CApplication::OnEvent(XBMC_Event& newEvent)
@@ -359,9 +357,6 @@ bool CApplication::Create(const CAppParamParser &params)
m_pSettingsComponent.reset(new CSettingsComponent());
m_pSettingsComponent->Init(params);
- m_pSettings.reset(new CSettings());
- CServiceBroker::RegisterSettings(m_pSettings);
-
// Announement service
m_pAnnouncementManager = std::make_shared<ANNOUNCEMENT::CAnnouncementManager>();
m_pAnnouncementManager->Start();
diff --git a/xbmc/Application.h b/xbmc/Application.h
index 89361a35b7..45e5576634 100644
--- a/xbmc/Application.h
+++ b/xbmc/Application.h
@@ -57,7 +57,6 @@ class IActionListener;
class CGUIComponent;
class CAppInboundProtocol;
class CSettingsComponent;
-class CSettings;
namespace ADDON
{
@@ -402,7 +401,6 @@ protected:
bool NotifyActionListeners(const CAction &action) const;
std::shared_ptr<ANNOUNCEMENT::CAnnouncementManager> m_pAnnouncementManager;
- std::shared_ptr<CSettings> m_pSettings; // @todo move to settingscomponent
std::unique_ptr<CSettingsComponent> m_pSettingsComponent;
std::unique_ptr<CGUIComponent> m_pGUI;
std::unique_ptr<CWinSystemBase> m_pWinSystem;
diff --git a/xbmc/ServiceBroker.cpp b/xbmc/ServiceBroker.cpp
index 675504fe13..be8fa28600 100644
--- a/xbmc/ServiceBroker.cpp
+++ b/xbmc/ServiceBroker.cpp
@@ -91,21 +91,11 @@ CSettingsComponent* CServiceBroker::GetSettingsComponent()
return m_pSettingsComponent;
}
-std::shared_ptr<CSettings> CServiceBroker::m_pSettings;
-
+// @todo to be removed with next commit
+#include "settings/SettingsComponent.h"
std::shared_ptr<CSettings> CServiceBroker::GetSettings()
{
- return m_pSettings;
-}
-
-void CServiceBroker::RegisterSettings(std::shared_ptr<CSettings> settings)
-{
- m_pSettings = settings;
-}
-
-void CServiceBroker::UnregisterSettings()
-{
- m_pSettings.reset();
+ return m_pSettingsComponent->GetSettings();;
}
GAME::CControllerManager& CServiceBroker::GetGameControllerManager()
diff --git a/xbmc/ServiceBroker.h b/xbmc/ServiceBroker.h
index d460037420..c0f67a8b60 100644
--- a/xbmc/ServiceBroker.h
+++ b/xbmc/ServiceBroker.h
@@ -118,9 +118,7 @@ public:
static void UnregisterSettingsComponent();
static CSettingsComponent* GetSettingsComponent();
- // @todo move seetings to settingscomponent
- static void RegisterSettings(std::shared_ptr<CSettings> settings);
- static void UnregisterSettings();
+ // @todo to be removed with next commit
static std::shared_ptr<CSettings> GetSettings();
static void RegisterWinSystem(CWinSystemBase *winsystem);
@@ -143,5 +141,4 @@ private:
static IAE* m_pActiveAE;
static std::shared_ptr<CAppInboundProtocol> m_pAppPort;
static CSettingsComponent* m_pSettingsComponent;
- static std::shared_ptr<CSettings> m_pSettings;
};
diff --git a/xbmc/ServiceManager.cpp b/xbmc/ServiceManager.cpp
index 5c6168cfd2..6be181bc4b 100644
--- a/xbmc/ServiceManager.cpp
+++ b/xbmc/ServiceManager.cpp
@@ -27,7 +27,6 @@
#include "interfaces/python/XBPython.h"
#include "pvr/PVRManager.h"
#include "network/Network.h"
-#include "settings/Settings.h"
#include "utils/FileExtensionProvider.h"
#include "windowing/WinSystem.h"
#include "powermanagement/PowerManager.h"
diff --git a/xbmc/settings/SettingsComponent.cpp b/xbmc/settings/SettingsComponent.cpp
index fccfab865a..ccaa2165cb 100644
--- a/xbmc/settings/SettingsComponent.cpp
+++ b/xbmc/settings/SettingsComponent.cpp
@@ -10,10 +10,12 @@
#include "AdvancedSettings.h"
#include "ServiceBroker.h"
+#include "Settings.h"
CSettingsComponent::CSettingsComponent()
{
m_advancedSettings.reset(new CAdvancedSettings());
+ m_settings.reset(new CSettings());
}
CSettingsComponent::~CSettingsComponent()
@@ -33,6 +35,11 @@ void CSettingsComponent::Deinit()
m_advancedSettings->Clear();
}
+std::shared_ptr<CSettings> CSettingsComponent::GetSettings()
+{
+ return m_settings;
+}
+
std::shared_ptr<CAdvancedSettings> CSettingsComponent::GetAdvancedSettings()
{
return m_advancedSettings;
diff --git a/xbmc/settings/SettingsComponent.h b/xbmc/settings/SettingsComponent.h
index 7c73f8372a..3c4b94f142 100644
--- a/xbmc/settings/SettingsComponent.h
+++ b/xbmc/settings/SettingsComponent.h
@@ -12,17 +12,21 @@
class CAppParamParser;
class CAdvancedSettings;
+class CSettings;
class CSettingsComponent
{
public:
CSettingsComponent();
virtual ~CSettingsComponent();
+
void Init(const CAppParamParser &params);
void Deinit();
+ std::shared_ptr<CSettings> GetSettings();
std::shared_ptr<CAdvancedSettings> GetAdvancedSettings();
protected:
+ std::shared_ptr<CSettings> m_settings;
std::shared_ptr<CAdvancedSettings> m_advancedSettings;
};
diff --git a/xbmc/test/TestBasicEnvironment.cpp b/xbmc/test/TestBasicEnvironment.cpp
index c3808e45a4..ba6a7a5666 100644
--- a/xbmc/test/TestBasicEnvironment.cpp
+++ b/xbmc/test/TestBasicEnvironment.cpp
@@ -38,9 +38,6 @@ void TestBasicEnvironment::SetUp()
m_pSettingsComponent.reset(new CSettingsComponent());
m_pSettingsComponent->Init(CAppParamParser());
- m_pSettings.reset(new CSettings());
- CServiceBroker::RegisterSettings(m_pSettings);
-
XFILE::CFile *f;
g_application.m_ServiceManager.reset(new CServiceManager());
@@ -106,9 +103,6 @@ void TestBasicEnvironment::TearDown()
CServiceBroker::GetSettings()->Uninitialize();
g_application.m_ServiceManager->DeinitTesting();
- CServiceBroker::UnregisterSettings();
- m_pSettings.reset();
-
m_pSettingsComponent->Deinit();
m_pSettingsComponent.reset();
}
diff --git a/xbmc/test/TestBasicEnvironment.h b/xbmc/test/TestBasicEnvironment.h
index 723aed401b..2d04fbf229 100644
--- a/xbmc/test/TestBasicEnvironment.h
+++ b/xbmc/test/TestBasicEnvironment.h
@@ -27,5 +27,4 @@ private:
void SetUpError();
std::string m_tempPath;
std::unique_ptr<CSettingsComponent> m_pSettingsComponent;
- std::shared_ptr<CSettings> m_pSettings;
};