summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/netsystemtime/ntp.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/noncore/settings/netsystemtime/ntp.cpp b/noncore/settings/netsystemtime/ntp.cpp
index 40b5531..0b13b6d 100644
--- a/noncore/settings/netsystemtime/ntp.cpp
+++ b/noncore/settings/netsystemtime/ntp.cpp
@@ -12,16 +12,17 @@
12#include <opie/oprocess.h> 12#include <opie/oprocess.h>
13#include <qpe/qpeapplication.h> 13#include <qpe/qpeapplication.h>
14#include <qpe/config.h> 14#include <qpe/config.h>
15#include <qpe/global.h> 15#include <qpe/global.h>
16#include <qpe/timeconversion.h> 16#include <qpe/timeconversion.h>
17#include <qpe/tzselect.h> 17#include <qpe/tzselect.h>
18#include <qpe/timestring.h> 18#include <qpe/timestring.h>
19#include <qpe/qpedialog.h> 19#include <qpe/qpedialog.h>
20#include <qpe/datebookdb.h>
20#include <sys/time.h> 21#include <sys/time.h>
21#include <time.h> 22#include <time.h>
22#include <stdlib.h> 23#include <stdlib.h>
23 24
24 25
25Ntp::Ntp( QWidget* parent, const char* name, WFlags fl ) 26Ntp::Ntp( QWidget* parent, const char* name, WFlags fl )
26 : SetDateTime( parent, name, fl ) 27 : SetDateTime( parent, name, fl )
27{ 28{
@@ -139,16 +140,23 @@ void Ntp::getNtpOutput(OProcess *proc, char *buffer, int buflen)
139void Ntp::ntpFinished(OProcess *p) 140void Ntp::ntpFinished(OProcess *p)
140{ 141{
141 qDebug("p->exitStatus() %i",p->exitStatus()); 142 qDebug("p->exitStatus() %i",p->exitStatus());
142 if (p->exitStatus()!=0 || !p->normalExit()) 143 if (p->exitStatus()!=0 || !p->normalExit())
143 { 144 {
144 slotProbeNtpServer(); 145 slotProbeNtpServer();
145 return; 146 return;
146 } 147 }
148
149 Global::writeHWClock();
150 // since time has changed quickly load in the datebookdb
151 // to allow the alarm server to get a better grip on itself
152 // (example re-trigger alarms for when we travel back in time)
153 DateBookDB db;
154
147 Config cfg("ntp",Config::User); 155 Config cfg("ntp",Config::User);
148 cfg.setGroup("lookups"); 156 cfg.setGroup("lookups");
149 int lastLookup = cfg.readNumEntry("time",0); 157 int lastLookup = cfg.readNumEntry("time",0);
150 int lookupCount = cfg.readNumEntry("count",0); 158 int lookupCount = cfg.readNumEntry("count",0);
151 bool lastNtp = cfg.readBoolEntry("lastNtp",false); 159 bool lastNtp = cfg.readBoolEntry("lastNtp",false);
152 int time = TimeConversion::toUTC( QDateTime::currentDateTime() ); 160 int time = TimeConversion::toUTC( QDateTime::currentDateTime() );
153 cfg.writeEntry("time", time); 161 cfg.writeEntry("time", time);
154 162