Small tidying up, replacing with GEO_NONE

This commit is contained in:
Magnus Homann 2012-08-29 00:09:37 +02:00
parent 412feddf43
commit cb0d9f0930
5 changed files with 10 additions and 12 deletions

View File

@ -15,7 +15,6 @@
#include "qgsmaptoolfeatureaction.h"
#include "qgsdistancearea.h"
#include "qgsfeature.h"
#include "qgsfield.h"
#include "qgsgeometry.h"
@ -111,7 +110,6 @@ bool QgsMapToolFeatureAction::doAction( QgsVectorLayer *layer, int x, int y )
// load identify radius from settings
QSettings settings;
double identifyValue = settings.value( "/Map/identifyRadius", QGis::DEFAULT_IDENTIFY_RADIUS ).toDouble();
QString ellipsoid = settings.value( "/qgis/measure/ellipsoid", "WGS84" ).toString();
if ( identifyValue <= 0.0 )
identifyValue = QGis::DEFAULT_IDENTIFY_RADIUS;

View File

@ -204,7 +204,7 @@ bool QgsMapToolIdentify::identifyVectorLayer( QgsVectorLayer *layer, int x, int
// load identify radius from settings
QSettings settings;
double identifyValue = settings.value( "/Map/identifyRadius", QGis::DEFAULT_IDENTIFY_RADIUS ).toDouble();
QString ellipsoid = settings.value( "/qgis/measure/ellipsoid", "WGS84" ).toString();
QString ellipsoid = settings.value( "/qgis/measure/ellipsoid", GEO_NONE ).toString();
if ( identifyValue <= 0.0 )
identifyValue = QGis::DEFAULT_IDENTIFY_RADIUS;

View File

@ -283,7 +283,7 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WFlags fl ) :
getEllipsoidList();
// Pre-select current ellipsoid
QString myEllipsoidId = settings.value( "/qgis/measure/ellipsoid", "WGS84" ).toString();
QString myEllipsoidId = settings.value( "/qgis/measure/ellipsoid", GEO_NONE ).toString();
cmbEllipsoid->setCurrentIndex( cmbEllipsoid->findText( getEllipsoidName( myEllipsoidId ), Qt::MatchExactly ) );
// Check if CRS transformation is on, or else turn combobox off
if ( QgisApp::instance()->mapCanvas()->mapRenderer()->hasCrsTransformEnabled() )

View File

@ -44,7 +44,7 @@ QgsDistanceArea::QgsDistanceArea()
mEllipsoidalMode = false;
mCoordTransform = new QgsCoordinateTransform;
setSourceCrs( GEOCRS_ID ); // WGS 84
setEllipsoid( "WGS84" );
setEllipsoid( GEO_NONE );
}

View File

@ -773,15 +773,15 @@ static QVariant fcnRound( const QVariantList& values , QgsFeature *f, QgsExpress
Q_UNUSED( f );
if ( values.length() == 2 )
{
double number = getDoubleValue( values.at( 0 ), parent );
double scaler = pow( 10.0, getIntValue( values.at( 1 ), parent ) );
return QVariant( qRound( number * scaler ) / scaler );
double number = getDoubleValue( values.at( 0 ), parent );
double scaler = pow( 10.0, getIntValue( values.at( 1 ), parent ) );
return QVariant( round( number * scaler ) / scaler );
}
if ( values.length() == 1 )
{
double number = getIntValue( values.at( 0 ), parent );
return QVariant( qRound( number) ).toInt();
double number = getIntValue( values.at( 0 ), parent );
return QVariant( round( number ) ).toInt();
}
return QVariant();
@ -933,10 +933,10 @@ bool QgsExpression::needsGeometry()
void QgsExpression::initGeomCalculator()
{
mCalc = new QgsDistanceArea;
mCalc->setEllipsoidalMode( false );
QSettings settings;
QString ellipsoid = settings.value( "/qgis/measure/ellipsoid", "WGS84" ).toString();
QString ellipsoid = settings.value( "/qgis/measure/ellipsoid", GEO_NONE ).toString();
mCalc->setEllipsoid( ellipsoid );
mCalc->setEllipsoidalMode( false );
}
bool QgsExpression::prepare( const QgsFieldMap& fields )