Sophie

Sophie

distrib > Mandriva > 2007.1 > i586 > by-pkgid > 954c3e3633b091567406300b6a2524c2 > files > 19

kdepim4-3.80.3-0.20070311.5mdv2007.1.src.rpm

--- kdepim-3.5.4/korganizer/koprefsdialog.cpp--	2006-07-27 19:50:56.000000000 +0200
+++ kdepim-3.5.4/korganizer/koprefsdialog.cpp	2006-07-27 19:58:12.000000000 +0200
@@ -193,13 +193,27 @@ class KOPrefsDialogTime : public KPrefsM
            pclose(f);
           }
     #else
-      if((f = fopen("/etc/timezone", "r")) != NULL) {
-        // get the currently set timezone
-        fgets(tempstring, 100, f);
-        tempstring[strlen(tempstring) - 1] = '\0';
-        sCurrentlySet = QString(tempstring);
-        fclose(f);
+    QFile file( "/etc/sysconfig/clock" );
+    if( file.exists())
+    {
+        QString line;
+        if ( file.open( IO_ReadOnly ) ) {
+            QTextStream stream( &file );
+            while ( !stream.atEnd() )
+            {
+                line = stream.readLine(); // line of text excluding '\n'
+                if( line.contains("ZONE")!=0)
+                {
+                    line = line.remove("ZONE=");
+                    break;
+                }
+            }
+            file.close();
+            }
+        if(!line.isEmpty())
+            sCurrentlySet = line;
       }
+
     #endif // !USE_SOLARIS
 
       mTimeZoneCombo->insertItem(i18n("[No selection]"));