Skip to content

Commit 61c3fe4

Browse files
authored
Merge pull request #7696 from m-kuhn/initializeCaptureModeNone
Initialize capture mode none
2 parents bf0962f + dea911d commit 61c3fe4

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

src/gui/qgsmaptoolcapture.cpp

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

4847
mSnapIndicator.reset( new QgsSnapIndicator( canvas ) );
@@ -51,6 +50,8 @@ QgsMapToolCapture::QgsMapToolCapture( QgsMapCanvas *canvas, QgsAdvancedDigitizin
5150

5251
connect( canvas, &QgsMapCanvas::currentLayerChanged,
5352
this, &QgsMapToolCapture::currentLayerChanged );
53+
54+
currentLayerChanged( canvas->currentLayer() );
5455
}
5556

5657
QgsMapToolCapture::~QgsMapToolCapture()
@@ -94,11 +95,9 @@ void QgsMapToolCapture::validationFinished()
9495

9596
void QgsMapToolCapture::currentLayerChanged( QgsMapLayer *layer )
9697
{
97-
if ( !mCaptureModeFromLayer )
98+
if ( mCaptureMode != CaptureNone )
9899
return;
99100

100-
mCaptureMode = CaptureNone;
101-
102101
QgsVectorLayer *vlayer = qobject_cast<QgsVectorLayer *>( layer );
103102
if ( !vlayer )
104103
{

src/gui/qgsmaptoolcapture.h

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

271-
bool mCaptureModeFromLayer;
272-
273271
std::unique_ptr<QgsSnapIndicator> mSnapIndicator;
274272

275273
/**

0 commit comments

Comments
 (0)