Diffstat (limited to 'noncore/settings/netsystemtime/ntp.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/settings/netsystemtime/ntp.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/noncore/settings/netsystemtime/ntp.cpp b/noncore/settings/netsystemtime/ntp.cpp index 551cedc..06d944d 100644 --- a/noncore/settings/netsystemtime/ntp.cpp +++ b/noncore/settings/netsystemtime/ntp.cpp | |||
@@ -102,2 +102,3 @@ void Ntp::saveConfig(){ | |||
102 | bool serversChanged = true; | 102 | bool serversChanged = true; |
103 | int curSrv = ComboNtpSrv->currentItem(); | ||
103 | QString edit = ComboNtpSrv->currentText(); | 104 | QString edit = ComboNtpSrv->currentText(); |
@@ -107,9 +108,12 @@ void Ntp::saveConfig(){ | |||
107 | if (serversChanged){ | 108 | if (serversChanged){ |
108 | Config ntpSrvs("/etc/ntpservers",Config::File); | 109 | Config ntpSrvs(QPEApplication::qpeDir()+"etc/ntpservers",Config::File); |
109 | ntpSrvs.setGroup("servers"); | 110 | ntpSrvs.setGroup("servers"); |
110 | ntpSrvs.writeEntry("count", srvCount); | 111 | ntpSrvs.writeEntry("count", ++srvCount); |
111 | for (int i = 0; i < srvCount; i++){ | 112 | ntpSrvs.setGroup("0"); |
113 | ntpSrvs.writeEntry( "name", edit ); | ||
114 | curSrv = 0; | ||
115 | for (int i = 1; i < srvCount; i++){ | ||
112 | qDebug("ntpSrvs[%i/%i]=%s",i,srvCount,ComboNtpSrv->text(i).latin1()); | 116 | qDebug("ntpSrvs[%i/%i]=%s",i,srvCount,ComboNtpSrv->text(i).latin1()); |
113 | ntpSrvs.setGroup(QString::number(i)); | 117 | ntpSrvs.setGroup(QString::number(i)); |
114 | ntpSrvs.writeEntry( "name", ComboNtpSrv->text(i) ); | 118 | ntpSrvs.writeEntry( "name", ComboNtpSrv->text(i-1) ); |
115 | } | 119 | } |
@@ -118,3 +122,3 @@ void Ntp::saveConfig(){ | |||
118 | cfg.setGroup("settings"); | 122 | cfg.setGroup("settings"); |
119 | cfg.writeEntry("ntpServer", ComboNtpSrv->currentItem()); | 123 | cfg.writeEntry("ntpServer", curSrv ); |
120 | cfg.writeEntry( "minLookupDiff", SpinBoxMinLookupDelay->value() ); | 124 | cfg.writeEntry( "minLookupDiff", SpinBoxMinLookupDelay->value() ); |