summary refs log tree commit diff
path: root/pkgs/desktops/kde-5/plasma-5.6/plasma-desktop/0003-tzdir.patch
blob: aba97b032f8a7062605647ad397d3478b2ad90a1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
From 0a8e2ae5cb64c5762408df920d99459b20d52b29 Mon Sep 17 00:00:00 2001
From: Thomas Tuegel <ttuegel@gmail.com>
Date: Sun, 22 Nov 2015 09:39:24 -0600
Subject: [PATCH 3/3] tzdir

---
 kcms/dateandtime/helper.cpp | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/kcms/dateandtime/helper.cpp b/kcms/dateandtime/helper.cpp
index 5171753..92b5d9e 100644
--- a/kcms/dateandtime/helper.cpp
+++ b/kcms/dateandtime/helper.cpp
@@ -181,7 +181,12 @@ int ClockHelper::tz( const QString& selectedzone )
 
     val = selectedzone;
 #else
-    QString tz = "/usr/share/zoneinfo/" + selectedzone;
+    QString tzdir = QString::fromLocal8Bit(qgetenv("TZDIR"));
+    QString tz = tzdir + "/" + selectedzone;
+    if (tzdir.isEmpty()) {
+      // Standard Linux path
+      tz = "/usr/share/zoneinfo/" + selectedzone;
+    }
 
     if (QFile::exists(tz)) { // make sure the new TZ really exists
         QFile::remove(QStringLiteral("/etc/localtime"));
-- 
2.6.3