summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/netsystemtime/ntp.cpp9
-rw-r--r--noncore/settings/netsystemtime/settime.cpp3
2 files changed, 8 insertions, 4 deletions
diff --git a/noncore/settings/netsystemtime/ntp.cpp b/noncore/settings/netsystemtime/ntp.cpp
index 830c0c3..7971f9a 100644
--- a/noncore/settings/netsystemtime/ntp.cpp
+++ b/noncore/settings/netsystemtime/ntp.cpp
@@ -150,6 +150,5 @@ void Ntp::ntpFinished(OProcess *p)
int lookupCount = cfg.readNumEntry("count",0);
+ bool lastNtp = cfg.readBoolEntry("lastNtp",false);
int time = TimeConversion::toUTC( QDateTime::currentDateTime() );
cfg.writeEntry("time", time);
- cfg.setGroup("correction");
- cfg.writeEntry("time", time);
@@ -160,7 +159,7 @@ void Ntp::ntpFinished(OProcess *p)
TextLabelTimeShift->setText(QString::number(timeShift)+tr(" seconds"));
- if ( lastLookup > 0 && secsSinceLast > 60* SpinBoxMinLookupDelay->value())
+ if ( lastNtp && lastLookup > 0 && secsSinceLast > 60* SpinBoxMinLookupDelay->value())
{
+ cfg.setGroup("lookup_"+QString::number(lookupCount));
lookupCount++;
cfg.writeEntry("count",lookupCount);
- cfg.setGroup("lookup_"+QString::number(lookupCount));
_shiftPerSec = timeShift / secsSinceLast;
@@ -169,2 +168,3 @@ void Ntp::ntpFinished(OProcess *p)
cfg.writeEntry("timeShift",QString::number(timeShift));
+ cfg.writeEntry("lastNtp",true);
}
@@ -230,2 +230,3 @@ void Ntp::preditctTime()
int lastTime = cfg.readNumEntry("time",0);
+ cfg.writeEntry("lastNtp",true);
setenv( "TZ", tz->currentZone(), 1 );
diff --git a/noncore/settings/netsystemtime/settime.cpp b/noncore/settings/netsystemtime/settime.cpp
index e7e604f..9c5323a 100644
--- a/noncore/settings/netsystemtime/settime.cpp
+++ b/noncore/settings/netsystemtime/settime.cpp
@@ -232,2 +232,5 @@ void SetDateTime::commitTime()
{
+ Config cfg("ntp",Config::User);
+ cfg.setGroup("lookups");
+ cfg.writeEntry("lastNtp",false);
tz->setFocus();