Skip to content

Commit

Permalink
changed requests
Browse files Browse the repository at this point in the history
  • Loading branch information
signedav committed Dec 20, 2017
1 parent 0b05030 commit a7b5ffc
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 21 deletions.
4 changes: 0 additions & 4 deletions python/gui/qgsmaptoolcapture.sip
Expand Up @@ -96,10 +96,6 @@ Clean a temporary rubberband
convenient method to clean members
%End

public slots:
void setCurrentLayer( QgsMapLayer *layer );


protected:

int nextPoint( const QgsPoint &mapPoint, QgsPoint &layerPoint );
Expand Down
8 changes: 4 additions & 4 deletions src/app/qgsmaptooladdfeature.cpp
Expand Up @@ -55,10 +55,10 @@ bool QgsMapToolAddFeature::addFeature( QgsVectorLayer *vlayer, QgsFeature *f, bo
return res;
}

void QgsMapToolAddFeature::digitized( const QgsFeature *f )
void QgsMapToolAddFeature::digitized( QgsFeature &f )
{
QgsVectorLayer *vlayer = currentVectorLayer();
bool res = addFeature( vlayer, const_cast<QgsFeature *>( f ), false );
bool res = addFeature( vlayer, &f, false );

if ( res && ( mode() == CaptureLine || mode() == CapturePolygon ) )
{
Expand All @@ -76,13 +76,13 @@ void QgsMapToolAddFeature::digitized( const QgsFeature *f )
//can only add topological points if background layer is editable...
if ( vl->geometryType() == QgsWkbTypes::PolygonGeometry && vl->isEditable() )
{
vl->addTopologicalPoints( f->geometry() );
vl->addTopologicalPoints( f.geometry() );
}
}
}
else if ( topologicalEditing )
{
vlayer->addTopologicalPoints( f->geometry() );
vlayer->addTopologicalPoints( f.geometry() );
}
}
}
2 changes: 1 addition & 1 deletion src/app/qgsmaptooladdfeature.h
Expand Up @@ -25,7 +25,7 @@ class APP_EXPORT QgsMapToolAddFeature : public QgsMapToolDigitizeFeature

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

void digitized( const QgsFeature *f ) override;
void digitized( QgsFeature &f ) override;

protected:

Expand Down
10 changes: 5 additions & 5 deletions src/app/qgsmaptooldigitizefeature.cpp
Expand Up @@ -47,9 +47,9 @@ QgsMapToolDigitizeFeature::QgsMapToolDigitizeFeature( QgsMapCanvas *canvas, QgsM
connect( QgisApp::instance(), &QgisApp::projectRead, this, &QgsMapToolDigitizeFeature::stopCapturing );
}

void QgsMapToolDigitizeFeature::digitized( const QgsFeature *f )
void QgsMapToolDigitizeFeature::digitized( QgsFeature &f )
{
emit digitizingCompleted( static_cast< const QgsFeature & >( *f ) );
emit digitizingCompleted( f );
}

void QgsMapToolDigitizeFeature::activate()
Expand All @@ -61,7 +61,7 @@ void QgsMapToolDigitizeFeature::activate()
if ( vlayer && vlayer->geometryType() == QgsWkbTypes::NullGeometry )
{
QgsFeature f;
digitized( &f );
digitized( f );
return;
}

Expand Down Expand Up @@ -202,7 +202,7 @@ void QgsMapToolDigitizeFeature::cadCanvasReleaseEvent( QgsMapMouseEvent *e )
f.setGeometry( g );
f.setValid( true );

digitized( &f );
digitized( f );

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

digitized( f.get() );
digitized( *f );

stopCapturing();
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsmaptooldigitizefeature.h
Expand Up @@ -29,7 +29,7 @@ class APP_EXPORT QgsMapToolDigitizeFeature : public QgsMapToolCapture

void cadCanvasReleaseEvent( QgsMapMouseEvent *e ) override;

virtual void digitized( const QgsFeature *f );
virtual void digitized( QgsFeature &f );

virtual void activate() override;
virtual void deactivate() override;
Expand Down
1 change: 0 additions & 1 deletion src/gui/qgsmapcanvas.cpp
Expand Up @@ -273,7 +273,6 @@ QgsMapLayer *QgsMapCanvas::layer( int index )
return nullptr;
}


void QgsMapCanvas::setCurrentLayer( QgsMapLayer *layer )
{
mCurrentLayer = layer;
Expand Down
4 changes: 2 additions & 2 deletions src/gui/qgsmaptoolcapture.cpp
Expand Up @@ -53,7 +53,7 @@ QgsMapToolCapture::QgsMapToolCapture( QgsMapCanvas *canvas, QgsAdvancedDigitizin
setCursor( QgsApplication::getThemeCursor( QgsApplication::Cursor::CapturePoint ) );

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

QgsMapToolCapture::~QgsMapToolCapture()
Expand Down Expand Up @@ -95,7 +95,7 @@ void QgsMapToolCapture::validationFinished()
}
}

void QgsMapToolCapture::setCurrentLayer( QgsMapLayer *layer )
void QgsMapToolCapture::currentLayerChanged( QgsMapLayer *layer )
{
if ( !mCaptureModeFromLayer )
return;
Expand Down
4 changes: 1 addition & 3 deletions src/gui/qgsmaptoolcapture.h
Expand Up @@ -112,9 +112,7 @@ class GUI_EXPORT QgsMapToolCapture : public QgsMapToolAdvancedDigitizing
private slots:
void validationFinished();
void addError( QgsGeometry::Error );

public slots:
void setCurrentLayer( QgsMapLayer *layer );
void currentLayerChanged( QgsMapLayer *layer );


protected:
Expand Down

0 comments on commit a7b5ffc

Please sign in to comment.