summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/netsystemtime/main.cpp6
-rw-r--r--noncore/settings/netsystemtime/ntp.cpp32
-rw-r--r--noncore/settings/netsystemtime/ntp.h9
-rw-r--r--noncore/settings/netsystemtime/opie-netsystemtime.control2
-rw-r--r--noncore/settings/netsystemtime/opie-netsystemtime.postinst7
-rw-r--r--noncore/settings/netsystemtime/opie-netsystemtime.postrm4
6 files changed, 42 insertions, 18 deletions
diff --git a/noncore/settings/netsystemtime/main.cpp b/noncore/settings/netsystemtime/main.cpp
index 5b01408..c6d5f9a 100644
--- a/noncore/settings/netsystemtime/main.cpp
+++ b/noncore/settings/netsystemtime/main.cpp
@@ -1,3 +1,3 @@
1//#include "settime.h" 1#include <stdio.h>
2#include "ntp.h" 2#include "ntp.h"
3#include <qpe/qpeapplication.h> 3#include <qpe/qpeapplication.h>
@@ -5,7 +5,9 @@
5int main( int argc, char ** argv ) 5int main( int argc, char ** argv )
6{ 6{
7 printf("This is netsystemtime\n");
8 printf("$Id$\n");
9
7 QPEApplication a( argc, argv ); 10 QPEApplication a( argc, argv );
8 11
9 // SetDateTime mw;
10 Ntp mw; 12 Ntp mw;
11 a.showMainWidget( &mw ); 13 a.showMainWidget( &mw );
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 @@
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>
@@ -43,4 +44,6 @@ Ntp::Ntp( QWidget* parent, const char* name, WFlags fl )
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
@@ -216,4 +219,5 @@ void Ntp::readLookups()
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 {
@@ -221,7 +225,6 @@ void Ntp::readLookups()
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));
@@ -296,2 +299,27 @@ void Ntp::ntpOutPut(QString out)
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
diff --git a/noncore/settings/netsystemtime/ntp.h b/noncore/settings/netsystemtime/ntp.h
index c78dc55..56e0131 100644
--- a/noncore/settings/netsystemtime/ntp.h
+++ b/noncore/settings/netsystemtime/ntp.h
@@ -8,4 +8,5 @@ class QString;
8class QTimer; 8class QTimer;
9class QSocket; 9class QSocket;
10class QCopChannel;
10 11
11class Ntp : public SetDateTime 12class Ntp : public SetDateTime
@@ -17,8 +18,11 @@ public:
17 ~Ntp(); 18 ~Ntp();
18 19
20public slots:
21 void setDocument (const QString &);
19protected: 22protected:
20 QDateTime predictedTime; 23 QDateTime predictedTime;
21 24 void makeChannel();
22 25protected slots:
26 void receive(const QCString &msg, const QByteArray &arg);
23private: 27private:
24 QString _ntpOutput; 28 QString _ntpOutput;
@@ -28,4 +32,5 @@ private:
28 QTimer *ntpTimer; 32 QTimer *ntpTimer;
29 QSocket *ntpSock; 33 QSocket *ntpSock;
34 QCopChannel *channel;
30 35
31 float getTimeShift(); 36 float getTimeShift();
diff --git a/noncore/settings/netsystemtime/opie-netsystemtime.control b/noncore/settings/netsystemtime/opie-netsystemtime.control
index 9251e5c..e4b744d 100644
--- a/noncore/settings/netsystemtime/opie-netsystemtime.control
+++ b/noncore/settings/netsystemtime/opie-netsystemtime.control
@@ -1,4 +1,4 @@
1Packagename: opie-netsystemtime 1Packagename: opie-netsystemtime
2Files: bin/netsystemtime apps/Settings/ntpdatetime.desktop etc/ntpservers 2Files: bin/netsystemtime apps/Settings/netsystemtime.desktop etc/ntpservers
3Priority: optional 3Priority: optional
4Section: opie/settings 4Section: opie/settings
diff --git a/noncore/settings/netsystemtime/opie-netsystemtime.postinst b/noncore/settings/netsystemtime/opie-netsystemtime.postinst
deleted file mode 100644
index 233cd31..0000000
--- a/noncore/settings/netsystemtime/opie-netsystemtime.postinst
+++ b/dev/null
@@ -1,7 +0,0 @@
1#!/bin/sh -v
2
3systime=`ipkg status | grep Package | grep -i systemtime | sed "s/Package://"`
4ipkg remove $pack
5
6cd $QPEDIR/bin/
7ln -s netsystemtime systemtime
diff --git a/noncore/settings/netsystemtime/opie-netsystemtime.postrm b/noncore/settings/netsystemtime/opie-netsystemtime.postrm
deleted file mode 100644
index 4b2ab7c..0000000
--- a/noncore/settings/netsystemtime/opie-netsystemtime.postrm
+++ b/dev/null
@@ -1,4 +0,0 @@
1#!/bin/sh -v
2
3cd $QPEDIR/bin/
4rm systemtime