author | tille <tille> | 2002-06-25 13:09:08 (UTC) |
---|---|---|
committer | tille <tille> | 2002-06-25 13:09:08 (UTC) |
commit | 8501705e4e50602aaabe9877e6d8821555e3a05a (patch) (unidiff) | |
tree | 3f34b6d0f8b7f7e692ccbefd91356685c322204f /noncore/settings/netsystemtime/ntp.cpp | |
parent | d282b4f9cba20305e237910aca531b0360666f13 (diff) | |
download | opie-8501705e4e50602aaabe9877e6d8821555e3a05a.zip opie-8501705e4e50602aaabe9877e6d8821555e3a05a.tar.gz opie-8501705e4e50602aaabe9877e6d8821555e3a05a.tar.bz2 |
included systemtime gui
not yet much funtionaliti
Diffstat (limited to 'noncore/settings/netsystemtime/ntp.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/settings/netsystemtime/ntp.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/noncore/settings/netsystemtime/ntp.cpp b/noncore/settings/netsystemtime/ntp.cpp index 04b113b..ddb1372 100644 --- a/noncore/settings/netsystemtime/ntp.cpp +++ b/noncore/settings/netsystemtime/ntp.cpp | |||
@@ -20,3 +20,3 @@ | |||
20 | Ntp::Ntp( QWidget* parent, const char* name, WFlags fl ) | 20 | Ntp::Ntp( QWidget* parent, const char* name, WFlags fl ) |
21 | : NtpBase( parent, name, fl ) | 21 | : SetDateTime( parent, name, fl ) |
22 | { | 22 | { |
@@ -42,2 +42,7 @@ Ntp::~Ntp() | |||
42 | { | 42 | { |
43 | |||
44 | } | ||
45 | |||
46 | void Ntp::accept() | ||
47 | { | ||
43 | Config cfg("ntp",Config::User); | 48 | Config cfg("ntp",Config::User); |
@@ -56,3 +61,2 @@ void Ntp::slotRunNtp() | |||
56 | qDebug("Error while executing ntp"); | 61 | qDebug("Error while executing ntp"); |
57 | outPut->append("\nError while executing\n\n"); | ||
58 | } | 62 | } |
@@ -67,3 +71,3 @@ void Ntp::getNtpOutput(OProcess *proc, char *buffer, int buflen) | |||
67 | { | 71 | { |
68 | outPut->append(lineStr); | 72 | // outPut->append(lineStr); |
69 | _ntpOutput += lineStr; | 73 | _ntpOutput += lineStr; |
@@ -92,3 +96,3 @@ void Ntp::ntpFinished(OProcess*) | |||
92 | _shiftPerSec = timeShift / secsSinceLast; | 96 | _shiftPerSec = timeShift / secsSinceLast; |
93 | float nextCorr = _maxOffset / _shiftPerSec; | 97 | // float nextCorr = _maxOffset / _shiftPerSec; |
94 | qDebug("secs since last lookup %i", secsSinceLast);qDebug("timeshift since last lookup %f", timeShift);qDebug("timeshift since per sec %f", _shiftPerSec); | 98 | qDebug("secs since last lookup %i", secsSinceLast);qDebug("timeshift since last lookup %f", timeShift);qDebug("timeshift since per sec %f", _shiftPerSec); |
@@ -107,3 +111,2 @@ void Ntp::correctClock() | |||
107 | int corr = int((now - lastTime) * _shiftPerSec); | 111 | int corr = int((now - lastTime) * _shiftPerSec); |
108 | outPut->append( "time will be shifted by "+QString::number(corr)+ "secs"); | ||
109 | struct timeval myTv; | 112 | struct timeval myTv; |
@@ -175,5 +178,5 @@ void Ntp::preditctTime() | |||
175 | int lastTime = cfg.readNumEntry("time",0); | 178 | int lastTime = cfg.readNumEntry("time",0); |
179 | setenv( "TZ", tz->currentZone(), 1 ); | ||
176 | int now = TimeConversion::toUTC( QDateTime::currentDateTime() ); | 180 | int now = TimeConversion::toUTC( QDateTime::currentDateTime() ); |
177 | int corr = int((now - lastTime) * _shiftPerSec); | 181 | int corr = int((now - lastTime) * _shiftPerSec); |
178 | outPut->append( "time will be shifted by "+QString::number(corr)+ "secs"); | ||
179 | TextLabelPredTime->setText(QDateTime::currentDateTime().addSecs(corr).toString()); | 182 | TextLabelPredTime->setText(QDateTime::currentDateTime().addSecs(corr).toString()); |