Skip to content

Commit

Permalink
Test map canvas pointer already when showing context menu
Browse files Browse the repository at this point in the history
  • Loading branch information
mhugent committed Jan 7, 2016
1 parent 36c6283 commit 1bc2c39
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/gui/attributetable/qgsdualview.cpp
Expand Up @@ -354,8 +354,9 @@ void QgsDualView::viewWillShowContextMenu( QMenu* menu, const QModelIndex& atInd
}

QgsVectorLayer* vl = mFilterModel->layer();
if ( vl && vl->geometryType() != QGis::NoGeometry )
{
QgsMapCanvas* canvas = mFilterModel->mapCanvas();
if ( canvas && vl && vl->geometryType() != QGis::NoGeometry )
{
menu->addAction( tr( "Zoom to feature" ), this, SLOT( zoomToCurrentFeature() ) );
}

Expand Down

0 comments on commit 1bc2c39

Please sign in to comment.