summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2004-09-19 23:18:26 (UTC)
committer llornkcor <llornkcor>2004-09-19 23:18:26 (UTC)
commit83272b7645c639669dddd676f17f64ad78ef9c63 (patch) (side-by-side diff)
tree5f2544600b6c468c6411d8abc605b95b2c0df95a
parentf3f74eed5dcf210562ef1c29f30fdbe893f0f7cd (diff)
downloadopie-83272b7645c639669dddd676f17f64ad78ef9c63.zip
opie-83272b7645c639669dddd676f17f64ad78ef9c63.tar.gz
opie-83272b7645c639669dddd676f17f64ad78ef9c63.tar.bz2
add more default servers in case ntpservers file is not found
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/settings/netsystemtime/settingstabwidget.cpp6
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
@@ -79,51 +79,53 @@ SettingsTabWidget::SettingsTabWidget( QWidget *parent )
// Display time server information selector
chNtpTab = new QCheckBox( tr( "Display time server information" ), container );
connect( chNtpTab, SIGNAL( toggled(bool) ), this, SIGNAL( displayNTPTab(bool) ) );
layout->addMultiCellWidget( chNtpTab, 5, 5, 0, 1 );
// Display time prediction information selector
chPredictTab = new QCheckBox( tr( "Display time prediction information" ), container );
connect( chPredictTab, SIGNAL( toggled(bool) ), this, SIGNAL( displayPredictTab(bool) ) );
layout->addMultiCellWidget( chPredictTab, 6, 6, 0, 1 );
// Space filler
layout->addItem( new QSpacerItem( 1, 1, QSizePolicy::Minimum, QSizePolicy::Expanding ), 7, 0 );
// Initialize values
QString ntpSrvsFile = QPEApplication::qpeDir();
ntpSrvsFile.append( "etc/ntpservers" );
Config ntpSrvs( ntpSrvsFile, Config::File );
ntpSrvs.setGroup( "servers" );
int srvCount = ntpSrvs.readNumEntry( "count", 0 );
for ( int i = 0; i < srvCount; i++ )
{
ntpSrvs.setGroup( QString::number( i ) );
cbTimeServer->insertItem( ntpSrvs.readEntry( "name" ) );
}
- if ( srvCount==0 )
+ if ( srvCount==0 ) {
cbTimeServer->insertItem( "time.fu-berlin.de" );
-
+ cbTimeServer->insertItem( "time-a.nist.gov" );
+ cbTimeServer->insertItem( "ntp.bri.connect.com.au" );
+ }
Config config( "ntp" );
config.setGroup( "settings" );
sbPredictDelay->setValue( config.readNumEntry( "minLookupDiff", 720 ) );
sbNtpDelay->setValue( config.readNumEntry( "ntpRefreshFreq", 1440 ) );
cbTimeServer->setCurrentItem( config.readNumEntry( "ntpServer", 0 ) );
chNtpTab->setChecked( config.readBoolEntry( "displayNtpTab", FALSE ) );
chPredictTab->setChecked( config.readBoolEntry( "displayPredictTab", FALSE ) );
}
SettingsTabWidget::~SettingsTabWidget()
{
}
void SettingsTabWidget::saveSettings()
{
int srvCount = cbTimeServer->count();
bool serversChanged = TRUE;
int curSrv = cbTimeServer->currentItem();
QString edit = cbTimeServer->currentText();
for ( int i = 0; i < srvCount; i++ )
{
if ( edit == cbTimeServer->text( i ) )
serversChanged = FALSE;
}