summaryrefslogtreecommitdiff
path: root/noncore/settings/netsystemtime/ntp.cpp
authortille <tille>2002-06-27 11:05:15 (UTC)
committer tille <tille>2002-06-27 11:05:15 (UTC)
commit4301065a4e43b0860774dca358a8027790a42f4f (patch) (side-by-side diff)
tree52e8abb5e859636b6b651727fb1dcf94350ba158 /noncore/settings/netsystemtime/ntp.cpp
parentf2cd92301181f3bc895b0d1701183e4da7b52812 (diff)
downloadopie-4301065a4e43b0860774dca358a8027790a42f4f.zip
opie-4301065a4e43b0860774dca358a8027790a42f4f.tar.gz
opie-4301065a4e43b0860774dca358a8027790a42f4f.tar.bz2
if postinst works, clicking on clockapplet should work too
Diffstat (limited to 'noncore/settings/netsystemtime/ntp.cpp') (more/less context) (ignore 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
@@ -22,13 +22,12 @@
#include <stdlib.h>
Ntp::Ntp( QWidget* parent, const char* name, WFlags fl )
: SetDateTime( parent, name, fl )
{
- qDebug("%s", QPEApplication::qpeDir().latin1());
Config ntpSrvs(QPEApplication::qpeDir()+"etc/ntpservers",Config::File);
ntpSrvs.setGroup("servers");
int srvCount = ntpSrvs.readNumEntry("count", 0 );
for (int i = 0; i < srvCount; i++)
{
ntpSrvs.setGroup(QString::number(i));
@@ -196,14 +195,15 @@ void Ntp::readLookups()
qDebug("lookupCount = %i",lookupCount);
TableLookups->setNumCols( 3 );
TableLookups->setNumRows( lookupCount);
TableLookups->horizontalHeader()->setLabel(1,tr("last [h]"));
TableLookups->horizontalHeader()->setLabel(2,tr("offset [s]"));
TableLookups->horizontalHeader()->setLabel(0,tr("shift [s/h]"));
- int cw = 50;//TableLookups->width()/4;
+ int cw = TableLookups->width()/4;
qDebug("column width %i",cw);
+ cw = 50;
TableLookups->setColumnWidth( 0, cw+30 );
TableLookups->setColumnWidth( 1, cw );
TableLookups->setColumnWidth( 2, cw );
TableLookups->sortColumn(0, false, true );
// TableLookups->setSorting( true );
for (int i=0; i < lookupCount; i++)
@@ -212,18 +212,18 @@ void Ntp::readLookups()
last = cfg.readEntry("secsSinceLast",0).toFloat();
shift = QString(cfg.readEntry("timeShift",0)).toFloat();
// qDebug("%i last %f",i,last);
// qDebug("%i shift %f",i,shift);
shiftPerSec = shift / last;
_shiftPerSec += shiftPerSec;
- TableLookups->setText( i,0,QString::number(shiftPerSec*60));
+ TableLookups->setText( i,0,QString::number(shiftPerSec*60*60));
TableLookups->setText( i,2,QString::number(shift));
- TableLookups->setText( i,1,QString::number(last/60));
+ TableLookups->setText( i,1,QString::number(last/(60*60)));
}
- _shiftPerSec /= lookupCount+1;
- TextLabelShift->setText(QString::number(_shiftPerSec)+tr(" seconds"));
+ _shiftPerSec /= lookupCount;
+ TextLabelShift->setText(QString::number(_shiftPerSec*60*60)+tr(" s/h"));
}
void Ntp::preditctTime()
{
Config cfg("ntp",Config::User);
cfg.setGroup("lookups");