Skip to content

Commit

Permalink
Merge pull request #9495 from m-kuhn/default-enable-geometry-checks
Browse files Browse the repository at this point in the history
Make default geometry checks configurable via settings [needs-docs]
  • Loading branch information
m-kuhn committed Mar 14, 2019
2 parents a7d060b + 1645799 commit ab530e4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
4 changes: 4 additions & 0 deletions resources/qgis_global_settings.ini
Expand Up @@ -83,3 +83,7 @@ PostgreSQL\default_timeout=30
# cause performance issues, as the records must all be loaded from the related table on display.
maxEntriesRelationWidget=100

[geometry_validation]
# A comma separated list of geometry validations to enable by default for newly added layers
# Available checks: QgsIsValidCheck,QgsGeometryGapCheck,QgsGeometryOverlapCheck,QgsGeometryMissingVertexCheck
default_checks=
7 changes: 7 additions & 0 deletions src/core/qgsgeometryoptions.cpp
Expand Up @@ -19,6 +19,13 @@

#include "qgsxmlutils.h"

#include "qgssettings.h"

QgsGeometryOptions::QgsGeometryOptions()
{
mGeometryChecks = QgsSettings().value( QStringLiteral( "geometry_validation/default_checks" ) ).toString().split( ',' ) ;
}

bool QgsGeometryOptions::removeDuplicateNodes() const
{
return mRemoveDuplicateNodes;
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsgeometryoptions.h
Expand Up @@ -41,7 +41,7 @@ class CORE_EXPORT QgsGeometryOptions : public QObject
/**
* Create a new QgsGeometryOptions object.
*/
QgsGeometryOptions() = default;
QgsGeometryOptions();

/**
* Automatically remove duplicate nodes on all geometries which are edited on this layer.
Expand Down

0 comments on commit ab530e4

Please sign in to comment.