summaryrefslogtreecommitdiff
path: root/noncore/settings/netsystemtime/ntp.cpp
Unidiff
Diffstat (limited to 'noncore/settings/netsystemtime/ntp.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/settings/netsystemtime/ntp.cpp32
1 files changed, 30 insertions, 2 deletions
diff --git a/noncore/settings/netsystemtime/ntp.cpp b/noncore/settings/netsystemtime/ntp.cpp
index 0b13b6d..2b779fa 100644
--- a/noncore/settings/netsystemtime/ntp.cpp
+++ b/noncore/settings/netsystemtime/ntp.cpp
@@ -18,6 +18,7 @@
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 <qpe/datebookdb.h>
21#include <qpe/qcopenvelope_qws.h>
21#include <sys/time.h> 22#include <sys/time.h>
22#include <time.h> 23#include <time.h>
23#include <stdlib.h> 24#include <stdlib.h>
@@ -42,6 +43,8 @@ Ntp::Ntp( QWidget* parent, const char* name, WFlags fl )
42 SpinBoxNtpDelay->setValue( cfg.readNumEntry("ntpRefreshFreq",42) ); 43 SpinBoxNtpDelay->setValue( cfg.readNumEntry("ntpRefreshFreq",42) );
43 ComboNtpSrv->setCurrentItem( cfg.readNumEntry("ntpServer", 0) ); 44 ComboNtpSrv->setCurrentItem( cfg.readNumEntry("ntpServer", 0) );
44 45
46 makeChannel();
47
45 ntpTimer = new QTimer(this); 48 ntpTimer = new QTimer(this);
46 49
47 ntpProcess = new OProcess( ); 50 ntpProcess = new OProcess( );
@@ -215,14 +218,14 @@ void Ntp::readLookups()
215 TableLookups->setColumnWidth( 2, cw ); 218 TableLookups->setColumnWidth( 2, cw );
216 TableLookups->sortColumn(0, false, true ); 219 TableLookups->sortColumn(0, false, true );
217 // TableLookups->setSorting( true ); 220 // TableLookups->setSorting( true );
221 _shiftPerSec = 0;
218 for (int i=0; i < lookupCount; i++) 222 for (int i=0; i < lookupCount; i++)
219 { 223 {
220 cfg.setGroup("lookup_"+QString::number(i)); 224 cfg.setGroup("lookup_"+QString::number(i));
221 last = cfg.readEntry("secsSinceLast",0).toFloat(); 225 last = cfg.readEntry("secsSinceLast",0).toFloat();
222 shift = QString(cfg.readEntry("timeShift",0)).toFloat(); 226 shift = QString(cfg.readEntry("timeShift",0)).toFloat();
223 // qDebug("%i last %f",i,last);
224 // qDebug("%i shift %f",i,shift);
225 shiftPerSec = shift / last; 227 shiftPerSec = shift / last;
228 qDebug("%i shift %f",i,shiftPerSec);
226 _shiftPerSec += shiftPerSec; 229 _shiftPerSec += shiftPerSec;
227 TableLookups->setText( i,0,QString::number(shiftPerSec*60*60)); 230 TableLookups->setText( i,0,QString::number(shiftPerSec*60*60));
228 TableLookups->setText( i,2,QString::number(shift)); 231 TableLookups->setText( i,2,QString::number(shift));
@@ -295,3 +298,28 @@ void Ntp::ntpOutPut(QString out)
295 MultiLineEditntpOutPut->setCursorPosition(MultiLineEditntpOutPut->numLines() + 1,0,FALSE); 298 MultiLineEditntpOutPut->setCursorPosition(MultiLineEditntpOutPut->numLines() + 1,0,FALSE);
296} 299}
297 300
301
302void Ntp::makeChannel()
303 {
304 channel = new QCopChannel( "QPE/Application/netsystemtime", this );
305 connect( channel, SIGNAL(received(const QCString&, const QByteArray&)),
306 this, SLOT(receive(const QCString&, const QByteArray&)) );
307}
308
309
310
311void Ntp::receive(const QCString &msg, const QByteArray &arg)
312{
313 qDebug("QCop "+msg+" "+QCString(arg));
314 if ( msg == "open(QString)" )
315 {
316 //qApp->exec();
317 }else{
318 qDebug("Ntp::receive: Huh what do ya want");
319 }
320}
321
322void Ntp::setDocument(const QString &fileName)
323{
324
325} \ No newline at end of file