Permalink
Browse files

[settings] fixed: set timezone during initialization

  • Loading branch information...
1 parent b6d31a3 commit e7bc4eb1cb8e55352f46e43d48d24c4b7d120f9e @vkosh vkosh committed Jan 28, 2014
Showing with 16 additions and 1 deletion.
  1. +6 −0 xbmc/linux/LinuxTimezone.cpp
  2. +4 −1 xbmc/linux/LinuxTimezone.h
  3. +6 −0 xbmc/settings/Settings.cpp
@@ -170,6 +170,12 @@ void CLinuxTimezone::OnSettingChanged(const CSetting *setting)
}
}
+void CLinuxTimezone::OnSettingsLoaded()
+{
+ SetTimezone(CSettings::Get().GetString("locale.timezone"));
+ CDateTime::ResetTimezoneBias();
+}
+
vector<CStdString> CLinuxTimezone::GetCounties()
{
return m_counties;
@@ -22,19 +22,22 @@
*/
#include "settings/lib/ISettingCallback.h"
+#include "settings/lib/ISettingsHandler.h"
#include "utils/StdString.h"
#include <vector>
#include <map>
class CSetting;
-class CLinuxTimezone : public ISettingCallback
+class CLinuxTimezone : public ISettingCallback, public ISettingsHandler
{
public:
CLinuxTimezone();
virtual void OnSettingChanged(const CSetting *setting);
+ virtual void OnSettingsLoaded();
+
CStdString GetOSConfiguredTimezone();
std::vector<CStdString> GetCounties();
@@ -468,6 +468,9 @@ void CSettings::Uninitialize()
m_settingsManager->UnregisterSettingsHandler(&CWakeOnAccess::Get());
m_settingsManager->UnregisterSettingsHandler(&CRssManager::Get());
m_settingsManager->UnregisterSettingsHandler(&g_application);
+#if defined(TARGET_LINUX)
+ m_settingsManager->UnregisterSettingsHandler(&g_timezone);
+#endif
m_initialized = false;
}
@@ -976,6 +979,9 @@ void CSettings::InitializeISettingsHandlers()
m_settingsManager->RegisterSettingsHandler(&CWakeOnAccess::Get());
m_settingsManager->RegisterSettingsHandler(&CRssManager::Get());
m_settingsManager->RegisterSettingsHandler(&g_application);
+#if defined(TARGET_LINUX)
+ m_settingsManager->RegisterSettingsHandler(&g_timezone);
+#endif
}
void CSettings::InitializeISubSettings()

0 comments on commit e7bc4eb

Please sign in to comment.