Skip to content
Permalink
Browse files

Use fallback default mode for snapping with bad configuration

  • Loading branch information
m-kuhn committed Oct 26, 2016
1 parent 322edff commit 469f07c07148f4650bebdfdfe4ef2af3eb04059c
Showing with 5 additions and 5 deletions.
  1. +5 −5 src/core/qgssnappingconfig.cpp
@@ -129,16 +129,16 @@ void QgsSnappingConfig::reset()
{
// get defaults values. They are both used for standard and advanced configuration (per layer)
bool enabled = QSettings().value( QStringLiteral( "/qgis/digitizing/default_advanced_snap_enabled" ), true ).toBool();
SnappingMode mode = ( SnappingMode )QSettings().value( QStringLiteral( "/qgis/digitizing/default_snap_mode" ), ( int )AllLayers ).toInt();
if ( mMode == 0 )
SnappingMode mode = static_cast<SnappingMode>( QSettings().value( QStringLiteral( "/qgis/digitizing/default_snap_mode" ), AllLayers ).toInt() );
if ( mode == 0 )
{
// backward compatibility with QGIS 2.x
// could be removed in 3.4+
mMode = AllLayers;
mode = AllLayers;
}
SnappingType type = ( SnappingType )QSettings().value( QStringLiteral( "/qgis/digitizing/default_snap_type" ), ( int )Vertex ).toInt();
SnappingType type = static_cast<SnappingType>( QSettings().value( QStringLiteral( "/qgis/digitizing/default_snap_type" ), Vertex ).toInt() );
double tolerance = QSettings().value( QStringLiteral( "/qgis/digitizing/default_snapping_tolerance" ), 0 ).toDouble();
QgsTolerance::UnitType units = ( QgsTolerance::UnitType )QSettings().value( QStringLiteral( "/qgis/digitizing/default_snapping_tolerance_unit" ), ( int )QgsTolerance::ProjectUnits ).toInt();
QgsTolerance::UnitType units = static_cast<QgsTolerance::UnitType>( QSettings().value( QStringLiteral( "/qgis/digitizing/default_snapping_tolerance_unit" ), QgsTolerance::ProjectUnits ).toInt() );

// assign main (standard) config
mEnabled = enabled;

0 comments on commit 469f07c

Please sign in to comment.
You can’t perform that action at this time.