Skip to content

Commit

Permalink
Make default geometry checks configurable via settings [needs-docs]
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Mar 13, 2019
1 parent 857fe53 commit 1645799
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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 1645799

Please sign in to comment.