-rw-r--r-- | noncore/settings/netsystemtime/ntp.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/noncore/settings/netsystemtime/ntp.cpp b/noncore/settings/netsystemtime/ntp.cpp index f60e38d..40805a0 100644 --- a/noncore/settings/netsystemtime/ntp.cpp +++ b/noncore/settings/netsystemtime/ntp.cpp @@ -91,25 +91,27 @@ Ntp::~Ntp() cfg.setGroup("settings"); cfg.writeEntry("ntpServer", ComboNtpSrv->currentItem()); cfg.writeEntry( "minLookupDiff", SpinBoxMinLookupDelay->value() ); cfg.writeEntry( "ntpRefreshFreq", SpinBoxNtpDelay->value() ); cfg.writeEntry( "advancedFeatures", CheckBoxAdvSettings->isChecked() ); } bool Ntp::ntpDelayElapsed() { Config cfg("ntp",Config::User); cfg.setGroup("lookups"); _lookupDiff = TimeConversion::toUTC(QDateTime::currentDateTime()) - cfg.readNumEntry("time",0); - return (_lookupDiff - (SpinBoxNtpDelay->value()*60)) > -60; + if (_lookupDiff < 0) return true; + int i =_lookupDiff - (SpinBoxNtpDelay->value()*60); + return i > -60; } QString Ntp::getNtpServer() { return ComboNtpSrv->currentText(); } void Ntp::slotRunNtp() { if ( !ntpDelayElapsed() ) { switch ( |