author | llornkcor <llornkcor> | 2004-09-19 23:18:26 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2004-09-19 23:18:26 (UTC) |
commit | 83272b7645c639669dddd676f17f64ad78ef9c63 (patch) (unidiff) | |
tree | 5f2544600b6c468c6411d8abc605b95b2c0df95a | |
parent | f3f74eed5dcf210562ef1c29f30fdbe893f0f7cd (diff) | |
download | opie-83272b7645c639669dddd676f17f64ad78ef9c63.zip opie-83272b7645c639669dddd676f17f64ad78ef9c63.tar.gz opie-83272b7645c639669dddd676f17f64ad78ef9c63.tar.bz2 |
add more default servers in case ntpservers file is not found
-rw-r--r-- | noncore/settings/netsystemtime/settingstabwidget.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/noncore/settings/netsystemtime/settingstabwidget.cpp b/noncore/settings/netsystemtime/settingstabwidget.cpp index 1307082..9315d2e 100644 --- a/noncore/settings/netsystemtime/settingstabwidget.cpp +++ b/noncore/settings/netsystemtime/settingstabwidget.cpp | |||
@@ -87,35 +87,37 @@ SettingsTabWidget::SettingsTabWidget( QWidget *parent ) | |||
87 | layout->addMultiCellWidget( chPredictTab, 6, 6, 0, 1 ); | 87 | layout->addMultiCellWidget( chPredictTab, 6, 6, 0, 1 ); |
88 | 88 | ||
89 | // Space filler | 89 | // Space filler |
90 | layout->addItem( new QSpacerItem( 1, 1, QSizePolicy::Minimum, QSizePolicy::Expanding ), 7, 0 ); | 90 | layout->addItem( new QSpacerItem( 1, 1, QSizePolicy::Minimum, QSizePolicy::Expanding ), 7, 0 ); |
91 | 91 | ||
92 | // Initialize values | 92 | // Initialize values |
93 | QString ntpSrvsFile = QPEApplication::qpeDir(); | 93 | QString ntpSrvsFile = QPEApplication::qpeDir(); |
94 | ntpSrvsFile.append( "etc/ntpservers" ); | 94 | ntpSrvsFile.append( "etc/ntpservers" ); |
95 | Config ntpSrvs( ntpSrvsFile, Config::File ); | 95 | Config ntpSrvs( ntpSrvsFile, Config::File ); |
96 | ntpSrvs.setGroup( "servers" ); | 96 | ntpSrvs.setGroup( "servers" ); |
97 | int srvCount = ntpSrvs.readNumEntry( "count", 0 ); | 97 | int srvCount = ntpSrvs.readNumEntry( "count", 0 ); |
98 | for ( int i = 0; i < srvCount; i++ ) | 98 | for ( int i = 0; i < srvCount; i++ ) |
99 | { | 99 | { |
100 | ntpSrvs.setGroup( QString::number( i ) ); | 100 | ntpSrvs.setGroup( QString::number( i ) ); |
101 | cbTimeServer->insertItem( ntpSrvs.readEntry( "name" ) ); | 101 | cbTimeServer->insertItem( ntpSrvs.readEntry( "name" ) ); |
102 | } | 102 | } |
103 | if ( srvCount==0 ) | 103 | if ( srvCount==0 ) { |
104 | cbTimeServer->insertItem( "time.fu-berlin.de" ); | 104 | cbTimeServer->insertItem( "time.fu-berlin.de" ); |
105 | 105 | cbTimeServer->insertItem( "time-a.nist.gov" ); | |
106 | cbTimeServer->insertItem( "ntp.bri.connect.com.au" ); | ||
107 | } | ||
106 | Config config( "ntp" ); | 108 | Config config( "ntp" ); |
107 | config.setGroup( "settings" ); | 109 | config.setGroup( "settings" ); |
108 | sbPredictDelay->setValue( config.readNumEntry( "minLookupDiff", 720 ) ); | 110 | sbPredictDelay->setValue( config.readNumEntry( "minLookupDiff", 720 ) ); |
109 | sbNtpDelay->setValue( config.readNumEntry( "ntpRefreshFreq", 1440 ) ); | 111 | sbNtpDelay->setValue( config.readNumEntry( "ntpRefreshFreq", 1440 ) ); |
110 | cbTimeServer->setCurrentItem( config.readNumEntry( "ntpServer", 0 ) ); | 112 | cbTimeServer->setCurrentItem( config.readNumEntry( "ntpServer", 0 ) ); |
111 | chNtpTab->setChecked( config.readBoolEntry( "displayNtpTab", FALSE ) ); | 113 | chNtpTab->setChecked( config.readBoolEntry( "displayNtpTab", FALSE ) ); |
112 | chPredictTab->setChecked( config.readBoolEntry( "displayPredictTab", FALSE ) ); | 114 | chPredictTab->setChecked( config.readBoolEntry( "displayPredictTab", FALSE ) ); |
113 | } | 115 | } |
114 | 116 | ||
115 | SettingsTabWidget::~SettingsTabWidget() | 117 | SettingsTabWidget::~SettingsTabWidget() |
116 | { | 118 | { |
117 | } | 119 | } |
118 | 120 | ||
119 | void SettingsTabWidget::saveSettings() | 121 | void SettingsTabWidget::saveSettings() |
120 | { | 122 | { |
121 | int srvCount = cbTimeServer->count(); | 123 | int srvCount = cbTimeServer->count(); |