Skip to content

Commit

Permalink
Show an empty string if precision is 0 or not valid
Browse files Browse the repository at this point in the history
  • Loading branch information
elpaso committed Oct 29, 2018
1 parent 12c75d3 commit ac54e96
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/app/qgsvectorlayerproperties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -408,11 +408,12 @@ QgsVectorLayerProperties::QgsVectorLayerProperties(
mGeometryPrecisionLineEdit->setValidator( new QDoubleValidator( mGeometryPrecisionLineEdit ) );

mRemoveDuplicateNodesCheckbox->setChecked( mLayer->geometryOptions()->removeDuplicateNodes() );
double precision( mLayer->geometryOptions()->geometryPrecision() );
bool ok = true;
QString precision( QLocale().toString( mLayer->geometryOptions()->geometryPrecision(), ok ) );
if ( ! ok )
precision = 0.0;
mGeometryPrecisionLineEdit->setText( precision );
QString precisionStr( QLocale().toString( precision, ok ) );
if ( precision == 0.0 || ! ok )
precisionStr = QString();
mGeometryPrecisionLineEdit->setText( precisionStr );

mPrecisionUnitsLabel->setText( QStringLiteral( "[%1]" ).arg( QgsUnitTypes::toAbbreviatedString( mLayer->crs().mapUnits() ) ) );

Expand Down

0 comments on commit ac54e96

Please sign in to comment.