Skip to content

Commit 43afffc

Browse files
committed
Revert "Simplify code"
This reverts commit dea911d.
1 parent 3cd6899 commit 43afffc

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/gui/qgsmaptoolcapture.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ QgsMapToolCapture::QgsMapToolCapture( QgsMapCanvas *canvas, QgsAdvancedDigitizin
4242
: QgsMapToolAdvancedDigitizing( canvas, cadDockWidget )
4343
, mCaptureMode( mode )
4444
{
45+
mCaptureModeFromLayer = mode == CaptureNone;
4546
mCapturing = false;
4647

4748
mSnapIndicator.reset( new QgsSnapIndicator( canvas ) );
@@ -95,9 +96,11 @@ void QgsMapToolCapture::validationFinished()
9596

9697
void QgsMapToolCapture::currentLayerChanged( QgsMapLayer *layer )
9798
{
98-
if ( mCaptureMode != CaptureNone )
99+
if ( !mCaptureModeFromLayer )
99100
return;
100101

102+
mCaptureMode = CaptureNone;
103+
101104
QgsVectorLayer *vlayer = qobject_cast<QgsVectorLayer *>( layer );
102105
if ( !vlayer )
103106
{

src/gui/qgsmaptoolcapture.h

+2
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,8 @@ class GUI_EXPORT QgsMapToolCapture : public QgsMapToolAdvancedDigitizing
268268
QList< QgsGeometry::Error > mGeomErrors;
269269
QList< QgsVertexMarker * > mGeomErrorMarkers;
270270

271+
bool mCaptureModeFromLayer;
272+
271273
std::unique_ptr<QgsSnapIndicator> mSnapIndicator;
272274

273275
/**

0 commit comments

Comments
 (0)