summaryrefslogtreecommitdiff
path: root/noncore/settings/netsystemtime/ntp.cpp
Unidiff
Diffstat (limited to 'noncore/settings/netsystemtime/ntp.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/settings/netsystemtime/ntp.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/noncore/settings/netsystemtime/ntp.cpp b/noncore/settings/netsystemtime/ntp.cpp
index 083b50f..830c0c3 100644
--- a/noncore/settings/netsystemtime/ntp.cpp
+++ b/noncore/settings/netsystemtime/ntp.cpp
@@ -25,7 +25,6 @@
25Ntp::Ntp( QWidget* parent, const char* name, WFlags fl ) 25Ntp::Ntp( QWidget* parent, const char* name, WFlags fl )
26 : SetDateTime( parent, name, fl ) 26 : SetDateTime( parent, name, fl )
27{ 27{
28 qDebug("%s", QPEApplication::qpeDir().latin1());
29 Config ntpSrvs(QPEApplication::qpeDir()+"etc/ntpservers",Config::File); 28 Config ntpSrvs(QPEApplication::qpeDir()+"etc/ntpservers",Config::File);
30 ntpSrvs.setGroup("servers"); 29 ntpSrvs.setGroup("servers");
31 int srvCount = ntpSrvs.readNumEntry("count", 0 ); 30 int srvCount = ntpSrvs.readNumEntry("count", 0 );
@@ -199,8 +198,9 @@ void Ntp::readLookups()
199 TableLookups->horizontalHeader()->setLabel(1,tr("last [h]")); 198 TableLookups->horizontalHeader()->setLabel(1,tr("last [h]"));
200 TableLookups->horizontalHeader()->setLabel(2,tr("offset [s]")); 199 TableLookups->horizontalHeader()->setLabel(2,tr("offset [s]"));
201 TableLookups->horizontalHeader()->setLabel(0,tr("shift [s/h]")); 200 TableLookups->horizontalHeader()->setLabel(0,tr("shift [s/h]"));
202 int cw = 50;//TableLookups->width()/4; 201 int cw = TableLookups->width()/4;
203 qDebug("column width %i",cw); 202 qDebug("column width %i",cw);
203 cw = 50;
204 TableLookups->setColumnWidth( 0, cw+30 ); 204 TableLookups->setColumnWidth( 0, cw+30 );
205 TableLookups->setColumnWidth( 1, cw ); 205 TableLookups->setColumnWidth( 1, cw );
206 TableLookups->setColumnWidth( 2, cw ); 206 TableLookups->setColumnWidth( 2, cw );
@@ -215,12 +215,12 @@ void Ntp::readLookups()
215 // qDebug("%i shift %f",i,shift); 215 // qDebug("%i shift %f",i,shift);
216 shiftPerSec = shift / last; 216 shiftPerSec = shift / last;
217 _shiftPerSec += shiftPerSec; 217 _shiftPerSec += shiftPerSec;
218 TableLookups->setText( i,0,QString::number(shiftPerSec*60)); 218 TableLookups->setText( i,0,QString::number(shiftPerSec*60*60));
219 TableLookups->setText( i,2,QString::number(shift)); 219 TableLookups->setText( i,2,QString::number(shift));
220 TableLookups->setText( i,1,QString::number(last/60)); 220 TableLookups->setText( i,1,QString::number(last/(60*60)));
221 } 221 }
222 _shiftPerSec /= lookupCount+1; 222 _shiftPerSec /= lookupCount;
223 TextLabelShift->setText(QString::number(_shiftPerSec)+tr(" seconds")); 223 TextLabelShift->setText(QString::number(_shiftPerSec*60*60)+tr(" s/h"));
224} 224}
225 225
226void Ntp::preditctTime() 226void Ntp::preditctTime()