3131#include < QMouseEvent>
3232#include < QSettings>
3333
34- QgsMapToolAddFeature::QgsMapToolAddFeature ( QgsMapCanvas* canvas, CaptureTool tool ): QgsMapToolCapture( canvas, tool )
34+ QgsMapToolAddFeature::QgsMapToolAddFeature ( QgsMapCanvas* canvas, CaptureMode tool ): QgsMapToolCapture( canvas, tool )
3535{
3636
3737}
@@ -85,7 +85,7 @@ void QgsMapToolAddFeature::canvasReleaseEvent( QMouseEvent * e )
8585 }
8686
8787 // POINT CAPTURING
88- if ( mTool == CapturePoint )
88+ if ( mCaptureMode == CapturePoint )
8989 {
9090 // check we only use this tool for point/multipoint layers
9191 if ( vlayer->geometryType () != QGis::Point )
@@ -209,18 +209,18 @@ void QgsMapToolAddFeature::canvasReleaseEvent( QMouseEvent * e )
209209 }
210210
211211 }
212- else if ( mTool == CaptureLine || mTool == CapturePolygon )
212+ else if ( mCaptureMode == CaptureLine || mCaptureMode == CapturePolygon )
213213 {
214214 // check we only use the line tool for line/multiline layers
215- if ( mTool == CaptureLine && vlayer->geometryType () != QGis::Line )
215+ if ( mCaptureMode == CaptureLine && vlayer->geometryType () != QGis::Line )
216216 {
217217 QMessageBox::information ( 0 , tr ( " Wrong editing tool" ),
218218 tr ( " Cannot apply the 'capture line' tool on this vector layer" ) );
219219 return ;
220220 }
221221
222222 // check we only use the polygon tool for polygon/multipolygon layers
223- if ( mTool == CapturePolygon && vlayer->geometryType () != QGis::Polygon )
223+ if ( mCaptureMode == CapturePolygon && vlayer->geometryType () != QGis::Polygon )
224224 {
225225 QMessageBox::information ( 0 , tr ( " Wrong editing tool" ),
226226 tr ( " Cannot apply the 'capture polygon' tool on this vector layer" ) );
@@ -253,7 +253,7 @@ void QgsMapToolAddFeature::canvasReleaseEvent( QMouseEvent * e )
253253 mCapturing = FALSE ;
254254
255255 // lines: bail out if there are not at least two vertices
256- if ( mTool == CaptureLine && mCaptureList .size () < 2 )
256+ if ( mCaptureMode == CaptureLine && mCaptureList .size () < 2 )
257257 {
258258 delete mRubberBand ;
259259 mRubberBand = NULL ;
@@ -262,7 +262,7 @@ void QgsMapToolAddFeature::canvasReleaseEvent( QMouseEvent * e )
262262 }
263263
264264 // polygons: bail out if there are not at least two vertices
265- if ( mTool == CapturePolygon && mCaptureList .size () < 3 )
265+ if ( mCaptureMode == CapturePolygon && mCaptureList .size () < 3 )
266266 {
267267 delete mRubberBand ;
268268 mRubberBand = NULL ;
@@ -276,7 +276,7 @@ void QgsMapToolAddFeature::canvasReleaseEvent( QMouseEvent * e )
276276 int size;
277277 char end = QgsApplication::endian ();
278278
279- if ( mTool == CaptureLine )
279+ if ( mCaptureMode == CaptureLine )
280280 {
281281 if ( layerWKBType == QGis::WKBLineString )
282282 {
0 commit comments