Blame SOURCES/kde-workspace-4.10.5-rhbz990146.patch

9bf2a2
diff -ur kde-workspace-orig/kcontrol/dateandtime/dtime.cpp kde-workspace-4.10.5/kcontrol/dateandtime/dtime.cpp
9bf2a2
--- kde-workspace-orig/kcontrol/dateandtime/dtime.cpp	2013-06-28 19:10:45.000000000 +0200
9bf2a2
+++ kde-workspace-4.10.5/kcontrol/dateandtime/dtime.cpp	2013-12-05 23:59:09.833603024 +0100
9bf2a2
@@ -210,6 +210,7 @@
9bf2a2
 
9bf2a2
   // read the currently set time zone
9bf2a2
   tzonelist->setSelected(KSystemTimeZones::local().name(), true);
9bf2a2
+  emit timeChanged(false);
9bf2a2
 }
9bf2a2
 
9bf2a2
 void Dtime::save( QVariantMap& helperargs )
9bf2a2
@@ -253,12 +254,11 @@
9bf2a2
 
9bf2a2
   QStringList selectedZones(tzonelist->selection());
9bf2a2
 
9bf2a2
-  if (selectedZones.count() > 0) {
9bf2a2
-    QString selectedzone(selectedZones[0]);
9bf2a2
+  if (!selectedZones.isEmpty()) {
9bf2a2
     helperargs["tz"] = true;
9bf2a2
-    helperargs["tzone"] = selectedzone;
9bf2a2
+    helperargs["tzone"] = selectedZones.first();
9bf2a2
   } else {
9bf2a2
-    helperargs["tzreset"] = true; // // make the helper reset the timezone
9bf2a2
+    helperargs["tzreset"] = true; // make the helper reset the timezone
9bf2a2
   }
9bf2a2
 
9bf2a2
   currentZone();
9bf2a2
Pouze v kde-workspace-4.10.5/kcontrol/dateandtime: dtime.cpp.orig
9bf2a2
diff -ur kde-workspace-orig/kcontrol/dateandtime/helper.cpp kde-workspace-4.10.5/kcontrol/dateandtime/helper.cpp
9bf2a2
--- kde-workspace-orig/kcontrol/dateandtime/helper.cpp	2013-06-28 19:10:44.000000000 +0200
9bf2a2
+++ kde-workspace-4.10.5/kcontrol/dateandtime/helper.cpp	2013-12-05 23:59:09.834603030 +0100
9bf2a2
@@ -175,30 +175,32 @@
9bf2a2
 
9bf2a2
         QString val = selectedzone;
9bf2a2
 #else
9bf2a2
-        QString tz = "/usr/share/zoneinfo/" + selectedzone;
9bf2a2
+    QString tz = "/usr/share/zoneinfo/" + selectedzone;
9bf2a2
 
9bf2a2
-        QString zic = KStandardDirs::findExe("zic", exePath);
9bf2a2
-        if (!zic.isEmpty()) {
9bf2a2
-            KProcess::execute(zic, QStringList() << "-l" << selectedzone);
9bf2a2
-        } else if (!QFile::remove("/etc/localtime")) {
9bf2a2
-          ret |= TimezoneError;
9bf2a2
-        } else if (!QFile::copy(tz, "/etc/localtime")) {
9bf2a2
-          ret |= TimezoneError;
9bf2a2
-        }
9bf2a2
-
9bf2a2
-        QFile fTimezoneFile("/etc/timezone");
9bf2a2
-
9bf2a2
-        if (fTimezoneFile.exists() && fTimezoneFile.open(QIODevice::WriteOnly | QIODevice::Truncate) ) {
9bf2a2
-            QTextStream t(&fTimezoneFile);
9bf2a2
-            t << selectedzone;
9bf2a2
-            fTimezoneFile.close();
9bf2a2
-        }
9bf2a2
+    if (QFile::exists(tz)) { // make sure the new TZ really exists
9bf2a2
+        QFile::remove("/etc/localtime");
9bf2a2
+    } else {
9bf2a2
+        return TimezoneError;
9bf2a2
+    }
9bf2a2
+
9bf2a2
+    if (!QFile::link(tz, "/etc/localtime")) { // fail if we can't setup the new timezone
9bf2a2
+        return TimezoneError;
9bf2a2
+    }
9bf2a2
+
9bf2a2
+    QFile fTimezoneFile("/etc/timezone");
9bf2a2
+
9bf2a2
+    if (fTimezoneFile.exists() && fTimezoneFile.open(QIODevice::WriteOnly | QIODevice::Truncate) ) {
9bf2a2
+        QTextStream t(&fTimezoneFile);
9bf2a2
+        t << selectedzone;
9bf2a2
+        fTimezoneFile.close();
9bf2a2
+    }
9bf2a2
 
9bf2a2
-        QString val = ':' + tz;
9bf2a2
 #endif // !USE_SOLARIS
9bf2a2
 
9bf2a2
-        setenv("TZ", val.toAscii(), 1);
9bf2a2
-        tzset();
9bf2a2
+    QString val = ':' + selectedzone;
9bf2a2
+
9bf2a2
+    setenv("TZ", val.toUtf8(), 1);
9bf2a2
+    tzset();
9bf2a2
 
9bf2a2
     return ret;
9bf2a2
 }
9bf2a2
@@ -206,11 +208,11 @@
9bf2a2
 int ClockHelper::tzreset()
9bf2a2
 {
9bf2a2
 #if !defined(USE_SOLARIS) // Do not update the System!
9bf2a2
-        unlink( "/etc/timezone" );
9bf2a2
-        unlink( "/etc/localtime" );
9bf2a2
+    unlink( "/etc/timezone" );
9bf2a2
+    unlink( "/etc/localtime" );
9bf2a2
 
9bf2a2
-        setenv("TZ", "", 1);
9bf2a2
-        tzset();
9bf2a2
+    setenv("TZ", "", 1);
9bf2a2
+    tzset();
9bf2a2
 #endif // !USE SOLARIS
9bf2a2
     return 0;
9bf2a2
 }
9bf2a2
diff -ur kde-workspace-orig/kcontrol/dateandtime/main.cpp kde-workspace-4.10.5/kcontrol/dateandtime/main.cpp
9bf2a2
--- kde-workspace-orig/kcontrol/dateandtime/main.cpp	2013-06-28 19:10:44.000000000 +0200
9bf2a2
+++ kde-workspace-4.10.5/kcontrol/dateandtime/main.cpp	2013-12-05 23:59:09.834603030 +0100
9bf2a2
@@ -95,7 +95,7 @@
9bf2a2
 
9bf2a2
   if (reply.failed()) {
9bf2a2
     if (reply.type() == ActionReply::KAuthError) {
9bf2a2
-          KMessageBox::error(this, i18n("Unable to authenticate/execute the action: %1, %2", reply.errorCode(), reply.errorDescription()));
9bf2a2
+        KMessageBox::error(this, i18n("Unable to authenticate/execute the action: %1, %2", reply.errorCode(), reply.errorDescription()));
9bf2a2
     } else {
9bf2a2
         dtime->processHelperErrors(reply.errorCode());
9bf2a2
     }