Skip to content

Commit e78dc23

Browse files
committed
Change to using UnitTypes, part deux
1 parent 9ac5790 commit e78dc23

File tree

2 files changed

+4
-14
lines changed

2 files changed

+4
-14
lines changed

src/app/qgsmaptoolidentify.cpp

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -392,17 +392,7 @@ void QgsMapToolIdentify::convertMeasurement( QgsDistanceArea &calc, double &meas
392392

393393
// Get the units for display
394394
QSettings settings;
395-
QString myDisplayUnitsTxt = settings.value( "/qgis/measure/displayunits", "meters" ).toString();
396-
397-
QGis::UnitType displayUnits;
398-
if ( myDisplayUnitsTxt == "feet" )
399-
{
400-
displayUnits = QGis::Feet;
401-
}
402-
else
403-
{
404-
displayUnits = QGis::Meters;
405-
}
395+
QGis::UnitType displayUnits = QGis::fromLiteral( settings.value( "/qgis/measure/displayunits", QGis::toLiteral( QGis::Meters ) ).toString() );
406396

407397
calc.convertMeasurement( measure, myUnits, displayUnits, isArea );
408398
u = myUnits;

src/app/qgsoptions.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -298,8 +298,8 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WFlags fl ) :
298298
}
299299

300300
// Set the units for measuring
301-
QString myUnitsTxt = QGis::fromLiteral( settings.value( "/qgis/measure/displayunits", QGis::toLiteral( QGis::Meters ) ).toString() );
302-
if ( myUnitsTxt == QGis::Feet )
301+
QGis::UnitType myDisplayUnits = QGis::fromLiteral( settings.value( "/qgis/measure/displayunits", QGis::toLiteral( QGis::Meters ) ).toString() );
302+
if ( myDisplayUnits == QGis::Feet )
303303
{
304304
radFeet->setChecked( true );
305305
}
@@ -948,7 +948,7 @@ void QgsOptions::saveOptions()
948948
}
949949
else
950950
{
951-
settings.setValue( "/qgis/measure/displayunits", QGis::toLiteral( QGis::Feet ) );
951+
settings.setValue( "/qgis/measure/displayunits", QGis::toLiteral( QGis::Meters ) );
952952
}
953953

954954
QString angleUnitString = "degrees";

0 commit comments

Comments
 (0)