Skip to content

Commit

Permalink
Merge pull request #7696 from m-kuhn/initializeCaptureModeNone
Browse files Browse the repository at this point in the history
Initialize capture mode none
  • Loading branch information
m-kuhn committed Aug 24, 2018
2 parents bf0962f + dea911d commit 61c3fe4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
7 changes: 3 additions & 4 deletions src/gui/qgsmaptoolcapture.cpp
Expand Up @@ -42,7 +42,6 @@ QgsMapToolCapture::QgsMapToolCapture( QgsMapCanvas *canvas, QgsAdvancedDigitizin
: QgsMapToolAdvancedDigitizing( canvas, cadDockWidget )
, mCaptureMode( mode )
{
mCaptureModeFromLayer = mode == CaptureNone;
mCapturing = false;

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

connect( canvas, &QgsMapCanvas::currentLayerChanged,
this, &QgsMapToolCapture::currentLayerChanged );

currentLayerChanged( canvas->currentLayer() );
}

QgsMapToolCapture::~QgsMapToolCapture()
Expand Down Expand Up @@ -94,11 +95,9 @@ void QgsMapToolCapture::validationFinished()

void QgsMapToolCapture::currentLayerChanged( QgsMapLayer *layer )
{
if ( !mCaptureModeFromLayer )
if ( mCaptureMode != CaptureNone )
return;

mCaptureMode = CaptureNone;

QgsVectorLayer *vlayer = qobject_cast<QgsVectorLayer *>( layer );
if ( !vlayer )
{
Expand Down
2 changes: 0 additions & 2 deletions src/gui/qgsmaptoolcapture.h
Expand Up @@ -268,8 +268,6 @@ class GUI_EXPORT QgsMapToolCapture : public QgsMapToolAdvancedDigitizing
QList< QgsGeometry::Error > mGeomErrors;
QList< QgsVertexMarker * > mGeomErrorMarkers;

bool mCaptureModeFromLayer;

std::unique_ptr<QgsSnapIndicator> mSnapIndicator;

/**
Expand Down

0 comments on commit 61c3fe4

Please sign in to comment.