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

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