Skip to content

Commit a7b5ffc

Browse files
committedDec 20, 2017
changed requests
1 parent 0b05030 commit a7b5ffc

8 files changed

+14
-21
lines changed
 

‎python/gui/qgsmaptoolcapture.sip

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,6 @@ Clean a temporary rubberband
9696
convenient method to clean members
9797
%End
9898

99-
public slots:
100-
void setCurrentLayer( QgsMapLayer *layer );
101-
102-
10399
protected:
104100

105101
int nextPoint( const QgsPoint &mapPoint, QgsPoint &layerPoint );

‎src/app/qgsmaptooladdfeature.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ bool QgsMapToolAddFeature::addFeature( QgsVectorLayer *vlayer, QgsFeature *f, bo
5555
return res;
5656
}
5757

58-
void QgsMapToolAddFeature::digitized( const QgsFeature *f )
58+
void QgsMapToolAddFeature::digitized( QgsFeature &f )
5959
{
6060
QgsVectorLayer *vlayer = currentVectorLayer();
61-
bool res = addFeature( vlayer, const_cast<QgsFeature *>( f ), false );
61+
bool res = addFeature( vlayer, &f, false );
6262

6363
if ( res && ( mode() == CaptureLine || mode() == CapturePolygon ) )
6464
{
@@ -76,13 +76,13 @@ void QgsMapToolAddFeature::digitized( const QgsFeature *f )
7676
//can only add topological points if background layer is editable...
7777
if ( vl->geometryType() == QgsWkbTypes::PolygonGeometry && vl->isEditable() )
7878
{
79-
vl->addTopologicalPoints( f->geometry() );
79+
vl->addTopologicalPoints( f.geometry() );
8080
}
8181
}
8282
}
8383
else if ( topologicalEditing )
8484
{
85-
vlayer->addTopologicalPoints( f->geometry() );
85+
vlayer->addTopologicalPoints( f.geometry() );
8686
}
8787
}
8888
}

‎src/app/qgsmaptooladdfeature.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class APP_EXPORT QgsMapToolAddFeature : public QgsMapToolDigitizeFeature
2525

2626
bool addFeature( QgsVectorLayer *vlayer, QgsFeature *f, bool showModal = true );
2727

28-
void digitized( const QgsFeature *f ) override;
28+
void digitized( QgsFeature &f ) override;
2929

3030
protected:
3131

‎src/app/qgsmaptooldigitizefeature.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ QgsMapToolDigitizeFeature::QgsMapToolDigitizeFeature( QgsMapCanvas *canvas, QgsM
4747
connect( QgisApp::instance(), &QgisApp::projectRead, this, &QgsMapToolDigitizeFeature::stopCapturing );
4848
}
4949

50-
void QgsMapToolDigitizeFeature::digitized( const QgsFeature *f )
50+
void QgsMapToolDigitizeFeature::digitized( QgsFeature &f )
5151
{
52-
emit digitizingCompleted( static_cast< const QgsFeature & >( *f ) );
52+
emit digitizingCompleted( f );
5353
}
5454

5555
void QgsMapToolDigitizeFeature::activate()
@@ -61,7 +61,7 @@ void QgsMapToolDigitizeFeature::activate()
6161
if ( vlayer && vlayer->geometryType() == QgsWkbTypes::NullGeometry )
6262
{
6363
QgsFeature f;
64-
digitized( &f );
64+
digitized( f );
6565
return;
6666
}
6767

@@ -202,7 +202,7 @@ void QgsMapToolDigitizeFeature::cadCanvasReleaseEvent( QgsMapMouseEvent *e )
202202
f.setGeometry( g );
203203
f.setValid( true );
204204

205-
digitized( &f );
205+
digitized( f );
206206

207207
// we are done with digitizing for now so instruct advanced digitizing dock to reset its CAD points
208208
cadDockWidget()->clearPoints();
@@ -324,7 +324,7 @@ void QgsMapToolDigitizeFeature::cadCanvasReleaseEvent( QgsMapMouseEvent *e )
324324
}
325325
f->setValid( true );
326326

327-
digitized( f.get() );
327+
digitized( *f );
328328

329329
stopCapturing();
330330
}

‎src/app/qgsmaptooldigitizefeature.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class APP_EXPORT QgsMapToolDigitizeFeature : public QgsMapToolCapture
2929

3030
void cadCanvasReleaseEvent( QgsMapMouseEvent *e ) override;
3131

32-
virtual void digitized( const QgsFeature *f );
32+
virtual void digitized( QgsFeature &f );
3333

3434
virtual void activate() override;
3535
virtual void deactivate() override;

‎src/gui/qgsmapcanvas.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,6 @@ QgsMapLayer *QgsMapCanvas::layer( int index )
273273
return nullptr;
274274
}
275275

276-
277276
void QgsMapCanvas::setCurrentLayer( QgsMapLayer *layer )
278277
{
279278
mCurrentLayer = layer;

‎src/gui/qgsmaptoolcapture.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ QgsMapToolCapture::QgsMapToolCapture( QgsMapCanvas *canvas, QgsAdvancedDigitizin
5353
setCursor( QgsApplication::getThemeCursor( QgsApplication::Cursor::CapturePoint ) );
5454

5555
connect( canvas, &QgsMapCanvas::currentLayerChanged,
56-
this, &QgsMapToolCapture::setCurrentLayer );
56+
this, &QgsMapToolCapture::currentLayerChanged );
5757
}
5858

5959
QgsMapToolCapture::~QgsMapToolCapture()
@@ -95,7 +95,7 @@ void QgsMapToolCapture::validationFinished()
9595
}
9696
}
9797

98-
void QgsMapToolCapture::setCurrentLayer( QgsMapLayer *layer )
98+
void QgsMapToolCapture::currentLayerChanged( QgsMapLayer *layer )
9999
{
100100
if ( !mCaptureModeFromLayer )
101101
return;

‎src/gui/qgsmaptoolcapture.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,7 @@ class GUI_EXPORT QgsMapToolCapture : public QgsMapToolAdvancedDigitizing
112112
private slots:
113113
void validationFinished();
114114
void addError( QgsGeometry::Error );
115-
116-
public slots:
117-
void setCurrentLayer( QgsMapLayer *layer );
115+
void currentLayerChanged( QgsMapLayer *layer );
118116

119117

120118
protected:

0 commit comments

Comments
 (0)
Please sign in to comment.