Skip to content

Commit e7c9b74

Browse files
tudorbarascu3nids
authored andcommittedJan 16, 2017
Show warning when adding more than 1 part to single geometry layers
1 parent 50e5d97 commit e7c9b74

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed
 

‎src/app/qgsmaptooladdpart.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ void QgsMapToolAddPart::cadCanvasReleaseEvent( QgsMapMouseEvent * e )
6565
return;
6666
}
6767

68+
bool isGeometryEmpty = false;
69+
if ( vlayer->selectedFeatures()[0].geometry().isEmpty() )
70+
isGeometryEmpty = true;
71+
6872
if ( !checkSelection() )
6973
{
7074
stopCapturing();
@@ -194,6 +198,12 @@ void QgsMapToolAddPart::cadCanvasReleaseEvent( QgsMapMouseEvent * e )
194198
vlayer->endEditCommand();
195199

196200
vlayer->triggerRepaint();
201+
202+
if (( !isGeometryEmpty ) && QgsWkbTypes::isSingleType( vlayer->wkbType() ) )
203+
{
204+
emit messageEmitted( tr( "Add part: Feature geom is single part and you've added more than one" ), QgsMessageBar::WARNING );
205+
}
206+
197207
return;
198208
}
199209

0 commit comments

Comments
 (0)
Please sign in to comment.