-rw-r--r-- | noncore/settings/netsystemtime/predicttabwidget.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/noncore/settings/netsystemtime/predicttabwidget.cpp b/noncore/settings/netsystemtime/predicttabwidget.cpp index 8dc889f..a9fe418 100644 --- a/noncore/settings/netsystemtime/predicttabwidget.cpp +++ b/noncore/settings/netsystemtime/predicttabwidget.cpp @@ -107,32 +107,33 @@ PredictTabWidget::PredictTabWidget( QWidget *parent ) tblLookups->sortColumn( 0, FALSE, TRUE ); _shiftPerSec = 0; QString grpname; for ( int i=0; i < lookupCount; i++ ) { grpname = "lookup_"; grpname.append( QString::number( i ) ); config.setGroup( grpname ); last = config.readEntry( "secsSinceLast", 0 ).toFloat(); shift = QString( config.readEntry( "timeShift", 0 ) ).toFloat(); shiftPerSec = shift / last; _shiftPerSec += shiftPerSec; tblLookups->setText( i, 0, QString::number( shiftPerSec * 60 * 60 ) ); tblLookups->setText( i, 2, QString::number( shift ) ); tblLookups->setText( i, 1, QString::number( last / ( 60 * 60 ) ) ); } + if(lookupCount) _shiftPerSec /= lookupCount; QString drift = QString::number( _shiftPerSec * 60 * 60); drift.append( tr( " s/h" ) ); lblDrift->setText( drift ); Config lconfig( "locale" ); lconfig.setGroup( "Location" ); tz = lconfig.readEntry( "Timezone", "America/New_York" ); } PredictTabWidget::~PredictTabWidget() { } void PredictTabWidget::setShiftPerSec( int i ) { |