author | tille <tille> | 2002-06-26 17:12:58 (UTC) |
---|---|---|
committer | tille <tille> | 2002-06-26 17:12:58 (UTC) |
commit | 18905bcc671622ab11b4e3d4447e4cd34f7308ee (patch) (side-by-side diff) | |
tree | d239f73841774b4514dea4476109b1e4336124a5 | |
parent | 9d692658a94c59889c6e46baaeae971226952eb8 (diff) | |
download | opie-18905bcc671622ab11b4e3d4447e4cd34f7308ee.zip opie-18905bcc671622ab11b4e3d4447e4cd34f7308ee.tar.gz opie-18905bcc671622ab11b4e3d4447e4cd34f7308ee.tar.bz2 |
network changes
-rw-r--r-- | noncore/settings/netsystemtime/ntp.cpp | 21 | ||||
-rw-r--r-- | noncore/settings/netsystemtime/ntp.h | 3 |
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 ) cfg.setGroup("settings"); -// _maxOffset = cfg.readNumEntry("maxOffset",5); -// _minLookupDiff = cfg.readNumEntry("minLookupDiff",10); SpinBoxMinLookupDelay->setValue( cfg.readNumEntry("minLookupDiff",41) ); @@ -46,2 +44,3 @@ Ntp::Ntp( QWidget* parent, const char* name, WFlags fl ) ntpTimer = new QTimer(this); + processTimer = new QTimer(this); ntpTimer->start(SpinBoxNtpDelay->value()*1000*60); @@ -118,2 +117,5 @@ void Ntp::slotRunNtp() ntpOutPut( tr("Running:")+"\nntpdate "+getNtpServer() ); + connect( processTimer, SIGNAL( timeout() ), SLOT(slotTimeoutNtpProcess()) ); + processTimer->start(2*1000*60, true); + ntpProcess->clearArguments(); @@ -140,4 +142,10 @@ void Ntp::getNtpOutput(OProcess *proc, char *buffer, int buflen) -void Ntp::ntpFinished(OProcess*) +void Ntp::ntpFinished(OProcess *p) { + if (!p->normalExit()) + { + slotProbeNtpServer(); + return; + } + processTimer->stop(); Config cfg("ntp",Config::User); @@ -263,3 +271,2 @@ void Ntp::slotCheckNtp(int i) } -// ntpTimer->start(SpinBoxNtpDelay->value()*1000*60); } @@ -281 +288,7 @@ void Ntp::ntpOutPut(QString out) } + +void Ntp::slotTimeoutNtpProcess() +{ + ntpProcess->kill(); + slotProbeNtpServer(); +} 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: OProcess *ntpProcess; - QTimer *ntpTimer; + QTimer *ntpTimer, *processTimer; QSocket *ntpSock; @@ -44,2 +44,3 @@ private slots: void slotNtpDelayChanged(int); + void slotTimeoutNtpProcess(); }; |