[Marble-commits] KDE/kdeedu/marble/src/lib [POSSIBLY UNSAFE]
Dennis Nienhüser
earthwings at gentoo.org
Thu Jan 7 18:46:23 CET 2010
SVN commit 1071185 by nienhueser:
Current location should be visible independent of navigation mode
M +29 -32 MarbleControlBox.cpp [POSSIBLY UNSAFE: system]
--- trunk/KDE/kdeedu/marble/src/lib/MarbleControlBox.cpp #1071184:1071185
@@ -386,42 +386,39 @@
void MarbleControlBox::receiveGpsCoordinates( const GeoDataCoordinates &in, qreal speed )
{
- Q_UNUSED( speed );
- if ( d->uiWidget.navigationCheckBox->isChecked() ) {
- QString unitString;
- QString speedString;
- QString distanceUnitString;
- QString distanceString;
- qreal unitSpeed = 0.0;
- qreal distance = 0.0;
+ QString unitString;
+ QString speedString;
+ QString distanceUnitString;
+ QString distanceString;
+ qreal unitSpeed = 0.0;
+ qreal distance = 0.0;
- switch ( d->m_locale->measureSystem() ) {
- case Marble::Metric:
- //kilometers per hour
- unitString = tr("km/h");
- unitSpeed = speed / 1000;
- distanceUnitString = tr("m");
- distance = in.altitude();
- break;
+ switch ( d->m_locale->measureSystem() ) {
+ case Marble::Metric:
+ //kilometers per hour
+ unitString = tr("km/h");
+ unitSpeed = speed / 1000;
+ distanceUnitString = tr("m");
+ distance = in.altitude();
+ break;
- case Marble::Imperial:
- //miles per hour
- unitString = tr("m/h");
- unitSpeed = (speed/1000) * KM2MI;
- distanceUnitString = tr("ft");
- distance = in.altitude() * M2FT;
- break;
- }
- // TODO read this value from the incoming signal
- speedString = QLocale::system().toString( unitSpeed, 'f', 1);
- distanceString = QString( "%1 %2" ).arg( distance, 0, 'f', 1, QChar(' ') ).arg( distanceUnitString );
+ case Marble::Imperial:
+ //miles per hour
+ unitString = tr("m/h");
+ unitSpeed = (speed/1000) * KM2MI;
+ distanceUnitString = tr("ft");
+ distance = in.altitude() * M2FT;
+ break;
+ }
+ // TODO read this value from the incoming signal
+ speedString = QLocale::system().toString( unitSpeed, 'f', 1);
+ distanceString = QString( "%1 %2" ).arg( distance, 0, 'f', 1, QChar(' ') ).arg( distanceUnitString );
- d->uiWidget.speedLabel->setText( speedString.rightJustified(5) + ' ' + unitString );
+ d->uiWidget.speedLabel->setText( speedString.rightJustified(5) + ' ' + unitString );
- d->uiWidget.longitudeValue->setText( in.lonToString() );
- d->uiWidget.latitudeValue->setText( in.latToString() );
- d->uiWidget.altitudeValue->setText( distanceString );
- }
+ d->uiWidget.longitudeValue->setText( in.lonToString() );
+ d->uiWidget.latitudeValue->setText( in.latToString() );
+ d->uiWidget.altitudeValue->setText( distanceString );
}
More information about the Marble-commits
mailing list