Skip to content
Permalink
Browse files

The nodetool only needs to consider spatial layers

  • Loading branch information
m-kuhn committed Jun 16, 2017
1 parent f237c6c commit a77f7914670389903f1b3fffa6d19ba4556b39a6
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/app/nodetool/qgsnodetool.cpp
@@ -421,7 +421,7 @@ void QgsNodeTool::cadCanvasReleaseEvent( QgsMapMouseEvent *e )
Q_FOREACH ( QgsMapLayer *layer, canvas()->layers() )
{
QgsVectorLayer *vlayer = qobject_cast<QgsVectorLayer *>( layer );
if ( !vlayer || !vlayer->isEditable() )
if ( !vlayer || !vlayer->isEditable() || !vlayer->isSpatial() )
continue;

QgsRectangle layerRect = toLayerCoordinates( vlayer, map_rect );

4 comments on commit a77f791

@m-kuhn

This comment has been minimized.

Copy link
Member Author

@m-kuhn m-kuhn replied Jun 16, 2017

@wonder-sk this fixes a crash for me when selecting nodes on the canvas and having non-spatial (postgres) layers in the project.
I wonder why they even return features on line 429 a77f791#diff-cd44035d76fa6e1430345db6a8a0d57aL429 at all. Opinions?

@wonder-sk

This comment has been minimized.

Copy link
Member

@wonder-sk wonder-sk replied Jun 16, 2017

hi @m-kuhn - thanks for the fix!

Looking into QgsPostgresFeatureIterator constructor it seems that filter rect is simply ignored when the layer does not have geometries. Not sure how consistent is it with other providers, but ideally that should return closed iterator as such request does not make much sense for non-spatial layer...

@m-kuhn

This comment has been minimized.

Copy link
Member Author

@m-kuhn m-kuhn replied Jun 16, 2017

Not sure how consistent is it with other providers, but ideally that should return closed iterator as such request does not make much sense for non-spatial layer...

Yes, that's what I would have expected as well. @jef-n @nyalldawson any further considerations from your side?

@3nids

This comment has been minimized.

Copy link
Member

@3nids 3nids replied Jun 16, 2017

+1 for a closed iterator

Please sign in to comment.
You can’t perform that action at this time.