Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Small tidying up, replacing with GEO_NONE
  • Loading branch information
homann committed Aug 29, 2012
1 parent 412fedd commit cb0d9f0
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 12 deletions.
2 changes: 0 additions & 2 deletions src/app/qgsmaptoolfeatureaction.cpp
Expand Up @@ -15,7 +15,6 @@

#include "qgsmaptoolfeatureaction.h"

#include "qgsdistancearea.h"
#include "qgsfeature.h"
#include "qgsfield.h"
#include "qgsgeometry.h"
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsmaptoolidentify.cpp
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsoptions.cpp
Expand Up @@ -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() )
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsdistancearea.cpp
Expand Up @@ -44,7 +44,7 @@ QgsDistanceArea::QgsDistanceArea()
mEllipsoidalMode = false;
mCoordTransform = new QgsCoordinateTransform;
setSourceCrs( GEOCRS_ID ); // WGS 84
setEllipsoid( "WGS84" );
setEllipsoid( GEO_NONE );
}


Expand Down
14 changes: 7 additions & 7 deletions src/core/qgsexpression.cpp
Expand Up @@ -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();
Expand Down Expand Up @@ -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 )
Expand Down

0 comments on commit cb0d9f0

Please sign in to comment.