Merge pull request #330634 from r-ryantm/auto-update/circumflex
[NixPkgs.git] / pkgs / desktops / plasma-5 / plasma-desktop / tzdir.patch
blob97504b330fed4057cbf321f746d8b80ca5012a39
1 Index: plasma-desktop-5.8.5/kcms/dateandtime/helper.cpp
2 ===================================================================
3 --- plasma-desktop-5.8.5.orig/kcms/dateandtime/helper.cpp
4 +++ plasma-desktop-5.8.5/kcms/dateandtime/helper.cpp
5 @@ -181,7 +181,12 @@ int ClockHelper::tz( const QString& sele
7 val = selectedzone;
8 #else
9 - QString tz = "/usr/share/zoneinfo/" + selectedzone;
10 + QString tzdir = QString::fromLocal8Bit(qgetenv("TZDIR"));
11 + QString tz = tzdir + "/" + selectedzone;
12 + if (tzdir.isEmpty()) {
13 + // Standard Linux path
14 + tz = "/usr/share/zoneinfo/" + selectedzone;
15 + }
17 if (QFile::exists(tz)) { // make sure the new TZ really exists
18 QFile::remove(QStringLiteral("/etc/localtime"));