summaryrefslogtreecommitdiff
authortille <tille>2002-06-26 17:12:58 (UTC)
committer tille <tille>2002-06-26 17:12:58 (UTC)
commit18905bcc671622ab11b4e3d4447e4cd34f7308ee (patch) (unidiff)
treed239f73841774b4514dea4476109b1e4336124a5
parent9d692658a94c59889c6e46baaeae971226952eb8 (diff)
downloadopie-18905bcc671622ab11b4e3d4447e4cd34f7308ee.zip
opie-18905bcc671622ab11b4e3d4447e4cd34f7308ee.tar.gz
opie-18905bcc671622ab11b4e3d4447e4cd34f7308ee.tar.bz2
network changes
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/netsystemtime/ntp.cpp21
-rw-r--r--noncore/settings/netsystemtime/ntp.h3
2 files changed, 19 insertions, 5 deletions
diff --git a/noncore/settings/netsystemtime/ntp.cpp b/noncore/settings/netsystemtime/ntp.cpp
index b2f5332..6a5c062 100644
--- a/noncore/settings/netsystemtime/ntp.cpp
+++ b/noncore/settings/netsystemtime/ntp.cpp
@@ -39,4 +39,2 @@ Ntp::Ntp( QWidget* parent, const char* name, WFlags fl )
39 cfg.setGroup("settings"); 39 cfg.setGroup("settings");
40 // _maxOffset = cfg.readNumEntry("maxOffset",5);
41// _minLookupDiff = cfg.readNumEntry("minLookupDiff",10);
42 SpinBoxMinLookupDelay->setValue( cfg.readNumEntry("minLookupDiff",41) ); 40 SpinBoxMinLookupDelay->setValue( cfg.readNumEntry("minLookupDiff",41) );
@@ -46,2 +44,3 @@ Ntp::Ntp( QWidget* parent, const char* name, WFlags fl )
46 ntpTimer = new QTimer(this); 44 ntpTimer = new QTimer(this);
45 processTimer = new QTimer(this);
47 ntpTimer->start(SpinBoxNtpDelay->value()*1000*60); 46 ntpTimer->start(SpinBoxNtpDelay->value()*1000*60);
@@ -118,2 +117,5 @@ void Ntp::slotRunNtp()
118 ntpOutPut( tr("Running:")+"\nntpdate "+getNtpServer() ); 117 ntpOutPut( tr("Running:")+"\nntpdate "+getNtpServer() );
118 connect( processTimer, SIGNAL( timeout() ), SLOT(slotTimeoutNtpProcess()) );
119 processTimer->start(2*1000*60, true);
120
119 ntpProcess->clearArguments(); 121 ntpProcess->clearArguments();
@@ -140,4 +142,10 @@ void Ntp::getNtpOutput(OProcess *proc, char *buffer, int buflen)
140 142
141void Ntp::ntpFinished(OProcess*) 143void Ntp::ntpFinished(OProcess *p)
142{ 144{
145 if (!p->normalExit())
146 {
147 slotProbeNtpServer();
148 return;
149 }
150 processTimer->stop();
143 Config cfg("ntp",Config::User); 151 Config cfg("ntp",Config::User);
@@ -263,3 +271,2 @@ void Ntp::slotCheckNtp(int i)
263 } 271 }
264 //ntpTimer->start(SpinBoxNtpDelay->value()*1000*60);
265} 272}
@@ -281 +288,7 @@ void Ntp::ntpOutPut(QString out)
281} 288}
289
290void Ntp::slotTimeoutNtpProcess()
291{
292 ntpProcess->kill();
293 slotProbeNtpServer();
294}
diff --git a/noncore/settings/netsystemtime/ntp.h b/noncore/settings/netsystemtime/ntp.h
index c78dc55..d166973 100644
--- a/noncore/settings/netsystemtime/ntp.h
+++ b/noncore/settings/netsystemtime/ntp.h
@@ -27,3 +27,3 @@ private:
27 OProcess *ntpProcess; 27 OProcess *ntpProcess;
28 QTimer *ntpTimer; 28 QTimer *ntpTimer, *processTimer;
29 QSocket *ntpSock; 29 QSocket *ntpSock;
@@ -44,2 +44,3 @@ private slots:
44 void slotNtpDelayChanged(int); 44 void slotNtpDelayChanged(int);
45 void slotTimeoutNtpProcess();
45}; 46};