Skip to content

Commit 469f07c

Browse files
committed
Use fallback default mode for snapping with bad configuration
1 parent 322edff commit 469f07c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/core/qgssnappingconfig.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -129,16 +129,16 @@ void QgsSnappingConfig::reset()
129129
{
130130
// get defaults values. They are both used for standard and advanced configuration (per layer)
131131
bool enabled = QSettings().value( QStringLiteral( "/qgis/digitizing/default_advanced_snap_enabled" ), true ).toBool();
132-
SnappingMode mode = ( SnappingMode )QSettings().value( QStringLiteral( "/qgis/digitizing/default_snap_mode" ), ( int )AllLayers ).toInt();
133-
if ( mMode == 0 )
132+
SnappingMode mode = static_cast<SnappingMode>( QSettings().value( QStringLiteral( "/qgis/digitizing/default_snap_mode" ), AllLayers ).toInt() );
133+
if ( mode == 0 )
134134
{
135135
// backward compatibility with QGIS 2.x
136136
// could be removed in 3.4+
137-
mMode = AllLayers;
137+
mode = AllLayers;
138138
}
139-
SnappingType type = ( SnappingType )QSettings().value( QStringLiteral( "/qgis/digitizing/default_snap_type" ), ( int )Vertex ).toInt();
139+
SnappingType type = static_cast<SnappingType>( QSettings().value( QStringLiteral( "/qgis/digitizing/default_snap_type" ), Vertex ).toInt() );
140140
double tolerance = QSettings().value( QStringLiteral( "/qgis/digitizing/default_snapping_tolerance" ), 0 ).toDouble();
141-
QgsTolerance::UnitType units = ( QgsTolerance::UnitType )QSettings().value( QStringLiteral( "/qgis/digitizing/default_snapping_tolerance_unit" ), ( int )QgsTolerance::ProjectUnits ).toInt();
141+
QgsTolerance::UnitType units = static_cast<QgsTolerance::UnitType>( QSettings().value( QStringLiteral( "/qgis/digitizing/default_snapping_tolerance_unit" ), QgsTolerance::ProjectUnits ).toInt() );
142142

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

0 commit comments

Comments
 (0)