Skip to content
Permalink
Browse files

Change to using UnitTypes, part deux

  • Loading branch information
homann committed Sep 4, 2012
1 parent 9ac5790 commit e78dc23a5a7c8dbb09de898772c925b1d5b3eb88
Showing with 4 additions and 14 deletions.
  1. +1 −11 src/app/qgsmaptoolidentify.cpp
  2. +3 −3 src/app/qgsoptions.cpp
@@ -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;
@@ -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 );
}
@@ -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";

0 comments on commit e78dc23

Please sign in to comment.
You can’t perform that action at this time.