mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-24 11:16:51 +00:00
xbmc: change the way tz setup is called
This commit is contained in:
parent
7418fac988
commit
e1389854a2
@ -0,0 +1,42 @@
|
||||
From c2717b64788fd05098f1d1f5499def9fbc4af957 Mon Sep 17 00:00:00 2001
|
||||
From: Stefan Saraev <stefan@saraev.ca>
|
||||
Date: Mon, 18 Aug 2014 17:46:54 +0300
|
||||
Subject: [PATCH] openelec: setup timezone
|
||||
|
||||
---
|
||||
xbmc/linux/LinuxTimezone.cpp | 12 ++++++++++++
|
||||
1 files changed, 12 insertions(+), 0 deletions(-)
|
||||
|
||||
diff --git a/xbmc/linux/LinuxTimezone.cpp b/xbmc/linux/LinuxTimezone.cpp
|
||||
index b4ffd13..5bf41eb 100644
|
||||
--- a/xbmc/linux/LinuxTimezone.cpp
|
||||
+++ b/xbmc/linux/LinuxTimezone.cpp
|
||||
@@ -39,6 +39,8 @@
|
||||
#include "settings/lib/Setting.h"
|
||||
#include "settings/Settings.h"
|
||||
|
||||
+#include <fstream>
|
||||
+
|
||||
using namespace std;
|
||||
|
||||
CLinuxTimezone::CLinuxTimezone() : m_IsDST(0)
|
||||
@@ -158,6 +160,16 @@ void CLinuxTimezone::OnSettingChanged(const CSetting *setting)
|
||||
const std::string &settingId = setting->GetId();
|
||||
if (settingId == "locale.timezone")
|
||||
{
|
||||
+ std::ofstream out("/storage/.cache/timezone");
|
||||
+ if (out)
|
||||
+ {
|
||||
+ const std::string tz = std::string("TIMEZONE=") + ((CSettingString*)setting)->GetValue().c_str();
|
||||
+ out << tz << std::endl;
|
||||
+ out.flush();
|
||||
+ out.close();
|
||||
+ system("systemctl restart tz-data.service");
|
||||
+ }
|
||||
+
|
||||
SetTimezone(((CSettingString*)setting)->GetValue());
|
||||
|
||||
CDateTime::ResetTimezoneBias();
|
||||
--
|
||||
1.7.2.5
|
||||
|
@ -1,26 +0,0 @@
|
||||
From 25be1b385303a8114d7e227ffab52a22de42ccd1 Mon Sep 17 00:00:00 2001
|
||||
From: Stefan Saraev <stefan@saraev.ca>
|
||||
Date: Tue, 26 Nov 2013 20:53:08 +0200
|
||||
Subject: [PATCH] run tzdata-setup on timezone change
|
||||
|
||||
---
|
||||
xbmc/linux/LinuxTimezone.cpp | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/xbmc/linux/LinuxTimezone.cpp b/xbmc/linux/LinuxTimezone.cpp
|
||||
index be7bce6..4000181 100644
|
||||
--- a/xbmc/linux/LinuxTimezone.cpp
|
||||
+++ b/xbmc/linux/LinuxTimezone.cpp
|
||||
@@ -158,6 +158,9 @@ void CLinuxTimezone::OnSettingChanged(const CSetting *setting)
|
||||
const std::string &settingId = setting->GetId();
|
||||
if (settingId == "locale.timezone")
|
||||
{
|
||||
+ const std::string cmd = std::string("sh /usr/lib/openelec/tzdata-setup ") + ((CSettingString*)setting)->GetValue().c_str();
|
||||
+ system(cmd.c_str());
|
||||
+
|
||||
SetTimezone(((CSettingString*)setting)->GetValue());
|
||||
|
||||
CDateTime::ResetTimezoneBias();
|
||||
--
|
||||
1.8.3.2
|
||||
|
Loading…
x
Reference in New Issue
Block a user