mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-11-15 13:37:21 +03:00
31 lines
967 B
Diff
31 lines
967 B
Diff
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
|
|
|