summaryrefslogtreecommitdiff
path: root/noncore/settings/netsystemtime/ntp.cpp
Side-by-side diff
Diffstat (limited to 'noncore/settings/netsystemtime/ntp.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/netsystemtime/ntp.cpp15
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 @@
Ntp::Ntp( QWidget* parent, const char* name, WFlags fl )
- : NtpBase( parent, name, fl )
+ : SetDateTime( parent, name, fl )
{
@@ -42,2 +42,7 @@ Ntp::~Ntp()
{
+
+}
+
+void Ntp::accept()
+{
Config cfg("ntp",Config::User);
@@ -56,3 +61,2 @@ void Ntp::slotRunNtp()
qDebug("Error while executing ntp");
- outPut->append("\nError while executing\n\n");
}
@@ -67,3 +71,3 @@ void Ntp::getNtpOutput(OProcess *proc, char *buffer, int buflen)
{
- outPut->append(lineStr);
+// outPut->append(lineStr);
_ntpOutput += lineStr;
@@ -92,3 +96,3 @@ void Ntp::ntpFinished(OProcess*)
_shiftPerSec = timeShift / secsSinceLast;
- float nextCorr = _maxOffset / _shiftPerSec;
+// float nextCorr = _maxOffset / _shiftPerSec;
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()
int corr = int((now - lastTime) * _shiftPerSec);
- outPut->append( "time will be shifted by "+QString::number(corr)+ "secs");
struct timeval myTv;
@@ -175,5 +178,5 @@ void Ntp::preditctTime()
int lastTime = cfg.readNumEntry("time",0);
+ setenv( "TZ", tz->currentZone(), 1 );
int now = TimeConversion::toUTC( QDateTime::currentDateTime() );
int corr = int((now - lastTime) * _shiftPerSec);
- outPut->append( "time will be shifted by "+QString::number(corr)+ "secs");
TextLabelPredTime->setText(QDateTime::currentDateTime().addSecs(corr).toString());