Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Change to using UnitTypes, part deux
  • Loading branch information
homann committed Sep 4, 2012
1 parent 9ac5790 commit e78dc23
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 14 deletions.
12 changes: 1 addition & 11 deletions src/app/qgsmaptoolidentify.cpp
Expand Up @@ -392,17 +392,7 @@ void QgsMapToolIdentify::convertMeasurement( QgsDistanceArea &calc, double &meas

// Get the units for display
QSettings settings;
QString myDisplayUnitsTxt = settings.value( "/qgis/measure/displayunits", "meters" ).toString();

QGis::UnitType displayUnits;
if ( myDisplayUnitsTxt == "feet" )
{
displayUnits = QGis::Feet;
}
else
{
displayUnits = QGis::Meters;
}
QGis::UnitType displayUnits = QGis::fromLiteral( settings.value( "/qgis/measure/displayunits", QGis::toLiteral( QGis::Meters ) ).toString() );

calc.convertMeasurement( measure, myUnits, displayUnits, isArea );
u = myUnits;
Expand Down
6 changes: 3 additions & 3 deletions src/app/qgsoptions.cpp
Expand Up @@ -298,8 +298,8 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WFlags fl ) :
}

// Set the units for measuring
QString myUnitsTxt = QGis::fromLiteral( settings.value( "/qgis/measure/displayunits", QGis::toLiteral( QGis::Meters ) ).toString() );
if ( myUnitsTxt == QGis::Feet )
QGis::UnitType myDisplayUnits = QGis::fromLiteral( settings.value( "/qgis/measure/displayunits", QGis::toLiteral( QGis::Meters ) ).toString() );
if ( myDisplayUnits == QGis::Feet )
{
radFeet->setChecked( true );
}
Expand Down Expand Up @@ -948,7 +948,7 @@ void QgsOptions::saveOptions()
}
else
{
settings.setValue( "/qgis/measure/displayunits", QGis::toLiteral( QGis::Feet ) );
settings.setValue( "/qgis/measure/displayunits", QGis::toLiteral( QGis::Meters ) );
}

QString angleUnitString = "degrees";
Expand Down

0 comments on commit e78dc23

Please sign in to comment.