Permalink
Browse files

reset the cached timezone bias value when the timezone changed on linux

  • Loading branch information...
1 parent 6801b9f commit 16466cf02248a1bad1e9710035af10d9ed69102a Lars Op den Kamp committed Oct 4, 2012
Showing with 18 additions and 1 deletion.
  1. +7 −1 xbmc/XBDateTime.cpp
  2. +1 −0 xbmc/XBDateTime.h
  3. +10 −0 xbmc/settings/GUIWindowSettingsCategory.cpp
View
@@ -872,9 +872,15 @@ void CDateTime::SetFromUTCDateTime(const CDateTime &dateTime)
m_state = tmp.m_state;
}
+static bool bGotTimezoneBias = false;
+
+void CDateTime::ResetTimezoneBias(void)
+{
+ bGotTimezoneBias = false;
+}
+
CDateTimeSpan CDateTime::GetTimezoneBias(void)
{
- static bool bGotTimezoneBias = false;
static CDateTimeSpan timezoneBias;
if (!bGotTimezoneBias)
View
@@ -196,6 +196,7 @@ class CDateTime : public IArchivable
void SetValid(bool yesNo);
bool IsValid() const;
+ static void ResetTimezoneBias(void);
static CDateTimeSpan GetTimezoneBias(void);
private:
@@ -1880,6 +1880,8 @@ void CGUIWindowSettingsCategory::OnSettingChanged(CBaseSettingControl *pSettingC
CGUISpinControlEx *tzControl = (CGUISpinControlEx *)GetControl(GetSetting("locale.timezone")->GetID());
g_guiSettings.SetString("locale.timezone", tzControl->GetLabel().c_str());
+
+ CDateTime::ResetTimezoneBias();
}
else if (strSetting.Equals("locale.timezone"))
{
@@ -1889,6 +1891,8 @@ void CGUIWindowSettingsCategory::OnSettingChanged(CBaseSettingControl *pSettingC
tzControl = (CGUISpinControlEx *)GetControl(GetSetting("locale.timezonecountry")->GetID());
g_guiSettings.SetString("locale.timezonecountry", tzControl->GetLabel().c_str());
+
+ CDateTime::ResetTimezoneBias();
}
#endif
else if (strSetting.Equals("lookandfeel.skinzoom"))
@@ -1908,12 +1912,18 @@ void CGUIWindowSettingsCategory::OnSettingChanged(CBaseSettingControl *pSettingC
{
if (g_PVRManager.CheckParentalPIN(g_localizeStrings.Get(19262).c_str()) &&
CGUIDialogYesNo::ShowAndGetInput(19098, 19186, 750, 0))
+ {
+ CDateTime::ResetTimezoneBias();
g_PVRManager.ResetDatabase();
+ }
}
else if (strSetting.Equals("epg.resetepg"))
{
if (CGUIDialogYesNo::ShowAndGetInput(19098, 19188, 750, 0))
+ {
+ CDateTime::ResetTimezoneBias();
g_PVRManager.ResetEPG();
+ }
}
else if (strSetting.Equals("pvrmanager.channelscan") && g_PVRManager.IsStarted())
{

0 comments on commit 16466cf

Please sign in to comment.