author | tille <tille> | 2002-06-27 10:14:52 (UTC) |
---|---|---|
committer | tille <tille> | 2002-06-27 10:14:52 (UTC) |
commit | f2cd92301181f3bc895b0d1701183e4da7b52812 (patch) (unidiff) | |
tree | ce9f50855ea4a294e8edb0022fc38a92ab6a011f | |
parent | 7c3fe018ad8855011c6e0441ed1bef2c09e293f2 (diff) | |
download | opie-f2cd92301181f3bc895b0d1701183e4da7b52812.zip opie-f2cd92301181f3bc895b0d1701183e4da7b52812.tar.gz opie-f2cd92301181f3bc895b0d1701183e4da7b52812.tar.bz2 |
ntpservers is in qpeDir
-rw-r--r-- | noncore/settings/netsystemtime/ntp.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/noncore/settings/netsystemtime/ntp.cpp b/noncore/settings/netsystemtime/ntp.cpp index 0abb401..083b50f 100644 --- a/noncore/settings/netsystemtime/ntp.cpp +++ b/noncore/settings/netsystemtime/ntp.cpp | |||
@@ -1,60 +1,61 @@ | |||
1 | #include "ntp.h" | 1 | #include "ntp.h" |
2 | #include <qpushbutton.h> | 2 | #include <qpushbutton.h> |
3 | #include <qregexp.h> | 3 | #include <qregexp.h> |
4 | #include <qtimer.h> | 4 | #include <qtimer.h> |
5 | #include <qtable.h> | 5 | #include <qtable.h> |
6 | #include <qlabel.h> | 6 | #include <qlabel.h> |
7 | #include <qsocket.h> | 7 | #include <qsocket.h> |
8 | #include <qlineedit.h> | 8 | #include <qlineedit.h> |
9 | #include <qspinbox.h> | 9 | #include <qspinbox.h> |
10 | #include <qmessagebox.h> | 10 | #include <qmessagebox.h> |
11 | #include <qmultilineedit.h> | 11 | #include <qmultilineedit.h> |
12 | #include <opie/oprocess.h> | 12 | #include <opie/oprocess.h> |
13 | #include <qpe/qpeapplication.h> | ||
13 | #include <qpe/config.h> | 14 | #include <qpe/config.h> |
14 | #include <qpe/global.h> | 15 | #include <qpe/global.h> |
15 | #include <qpe/timeconversion.h> | 16 | #include <qpe/timeconversion.h> |
16 | #include <qpe/tzselect.h> | 17 | #include <qpe/tzselect.h> |
17 | #include <qpe/timestring.h> | 18 | #include <qpe/timestring.h> |
18 | #include <qpe/qpedialog.h> | 19 | #include <qpe/qpedialog.h> |
19 | #include <sys/time.h> | 20 | #include <sys/time.h> |
20 | #include <time.h> | 21 | #include <time.h> |
21 | #include <stdlib.h> | 22 | #include <stdlib.h> |
22 | 23 | ||
23 | 24 | ||
24 | Ntp::Ntp( QWidget* parent, const char* name, WFlags fl ) | 25 | Ntp::Ntp( QWidget* parent, const char* name, WFlags fl ) |
25 | : SetDateTime( parent, name, fl ) | 26 | : SetDateTime( parent, name, fl ) |
26 | { | 27 | { |
27 | 28 | qDebug("%s", QPEApplication::qpeDir().latin1()); | |
28 | Config ntpSrvs("/etc/ntpservers",Config::File); | 29 | Config ntpSrvs(QPEApplication::qpeDir()+"etc/ntpservers",Config::File); |
29 | ntpSrvs.setGroup("servers"); | 30 | ntpSrvs.setGroup("servers"); |
30 | int srvCount = ntpSrvs.readNumEntry("count", 0 ); | 31 | int srvCount = ntpSrvs.readNumEntry("count", 0 ); |
31 | for (int i = 0; i < srvCount; i++) | 32 | for (int i = 0; i < srvCount; i++) |
32 | { | 33 | { |
33 | ntpSrvs.setGroup(QString::number(i)); | 34 | ntpSrvs.setGroup(QString::number(i)); |
34 | ComboNtpSrv->insertItem( ntpSrvs.readEntry("name") ); | 35 | ComboNtpSrv->insertItem( ntpSrvs.readEntry("name") ); |
35 | } | 36 | } |
36 | if ( srvCount==0 ) ComboNtpSrv->insertItem(tr("time.fu-berlin.de")); | 37 | if ( srvCount==0 ) ComboNtpSrv->insertItem(tr("time.fu-berlin.de")); |
37 | 38 | ||
38 | Config cfg("ntp",Config::User); | 39 | Config cfg("ntp",Config::User); |
39 | cfg.setGroup("settings"); | 40 | cfg.setGroup("settings"); |
40 | SpinBoxMinLookupDelay->setValue( cfg.readNumEntry("minLookupDiff",41) ); | 41 | SpinBoxMinLookupDelay->setValue( cfg.readNumEntry("minLookupDiff",41) ); |
41 | SpinBoxNtpDelay->setValue( cfg.readNumEntry("ntpRefreshFreq",42) ); | 42 | SpinBoxNtpDelay->setValue( cfg.readNumEntry("ntpRefreshFreq",42) ); |
42 | ComboNtpSrv->setCurrentItem( cfg.readNumEntry("ntpServer", 0) ); | 43 | ComboNtpSrv->setCurrentItem( cfg.readNumEntry("ntpServer", 0) ); |
43 | 44 | ||
44 | ntpTimer = new QTimer(this); | 45 | ntpTimer = new QTimer(this); |
45 | 46 | ||
46 | ntpProcess = new OProcess( ); | 47 | ntpProcess = new OProcess( ); |
47 | connect( SpinBoxNtpDelay, SIGNAL( valueChanged(int) ), | 48 | connect( SpinBoxNtpDelay, SIGNAL( valueChanged(int) ), |
48 | SLOT(slotNtpDelayChanged(int)) ); | 49 | SLOT(slotNtpDelayChanged(int)) ); |
49 | 50 | ||
50 | ntpSock = new QSocket( this ); | 51 | ntpSock = new QSocket( this ); |
51 | connect( ntpSock, SIGNAL( error(int) ), | 52 | connect( ntpSock, SIGNAL( error(int) ), |
52 | SLOT(slotCheckNtp(int)) ); | 53 | SLOT(slotCheckNtp(int)) ); |
53 | slotProbeNtpServer(); | 54 | slotProbeNtpServer(); |
54 | 55 | ||
55 | connect ( ntpProcess, SIGNAL(receivedStdout(OProcess*,char*,int)), | 56 | connect ( ntpProcess, SIGNAL(receivedStdout(OProcess*,char*,int)), |
56 | this, SLOT(getNtpOutput(OProcess*,char*,int))); | 57 | this, SLOT(getNtpOutput(OProcess*,char*,int))); |
57 | connect ( ntpProcess, SIGNAL(processExited(OProcess*)), | 58 | connect ( ntpProcess, SIGNAL(processExited(OProcess*)), |
58 | this, SLOT(ntpFinished(OProcess*))); | 59 | this, SLOT(ntpFinished(OProcess*))); |
59 | connect(runNtp, SIGNAL(clicked()), this, SLOT(slotRunNtp())); | 60 | connect(runNtp, SIGNAL(clicked()), this, SLOT(slotRunNtp())); |
60 | connect(PushButtonPredict, SIGNAL(clicked()), this, SLOT(preditctTime())); | 61 | connect(PushButtonPredict, SIGNAL(clicked()), this, SLOT(preditctTime())); |