Diffstat (limited to 'noncore/settings/netsystemtime/ntp.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/netsystemtime/ntp.cpp | 32 |
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 @@ -19,4 +19,5 @@ #include <qpe/qpedialog.h> #include <qpe/datebookdb.h> +#include <qpe/qcopenvelope_qws.h> #include <sys/time.h> #include <time.h> @@ -43,4 +44,6 @@ Ntp::Ntp( QWidget* parent, const char* name, WFlags fl ) ComboNtpSrv->setCurrentItem( cfg.readNumEntry("ntpServer", 0) ); + makeChannel(); + ntpTimer = new QTimer(this); @@ -216,4 +219,5 @@ void Ntp::readLookups() TableLookups->sortColumn(0, false, true ); // TableLookups->setSorting( true ); + _shiftPerSec = 0; for (int i=0; i < lookupCount; i++) { @@ -221,7 +225,6 @@ void Ntp::readLookups() last = cfg.readEntry("secsSinceLast",0).toFloat(); shift = QString(cfg.readEntry("timeShift",0)).toFloat(); -// qDebug("%i last %f",i,last); -// qDebug("%i shift %f",i,shift); shiftPerSec = shift / last; + qDebug("%i shift %f",i,shiftPerSec); _shiftPerSec += shiftPerSec; TableLookups->setText( i,0,QString::number(shiftPerSec*60*60)); @@ -296,2 +299,27 @@ void Ntp::ntpOutPut(QString out) } + +void Ntp::makeChannel() +{ + channel = new QCopChannel( "QPE/Application/netsystemtime", this ); + connect( channel, SIGNAL(received(const QCString&, const QByteArray&)), + this, SLOT(receive(const QCString&, const QByteArray&)) ); +} + + + +void Ntp::receive(const QCString &msg, const QByteArray &arg) +{ + qDebug("QCop "+msg+" "+QCString(arg)); + if ( msg == "open(QString)" ) + { + // qApp->exec(); + }else{ + qDebug("Ntp::receive: Huh what do ya want"); + } +} + +void Ntp::setDocument(const QString &fileName) +{ + +}
\ No newline at end of file |