nixpkgs/pkgs/desktops/kde-5/plasma/plasma-desktop/0003-tzdir.patch
Thomas Tuegel c8885106c1 kde5.plasma: 5.7.0 -> 5.7.1
- Update from Plasma 5.7.0 to 5.7.1.
- Remove the version number from the directory storing the Plasma Nix
  expressions. It is not necessary to version the Nix expressions now
  that we keep only one version in Nixpkgs.
- Fix a bug in generate-kde-plasma.sh which prevented it from finding
  its helper script.
- Automatically redirect the output of generate-kde-plasma.sh to make
  the update script even easier to use.
2016-07-13 13:54:42 -05:00

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