Skip to content

Commit

Permalink
Transactions: addFeature propagates new feature id
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Nov 27, 2015
1 parent 055ef76 commit 497191b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/core/qgsvectorlayereditpassthrough.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@
bool QgsVectorLayerEditPassthrough::addFeature( QgsFeature& f )
{

if ( L->dataProvider()->addFeatures( QgsFeatureList() << f ) )
QgsFeatureList fl;
fl << f;
if ( L->dataProvider()->addFeatures( fl) )
{
f.setFeatureId( fl.first().id() );
emit featureAdded( f.id() );
return true;
}
Expand Down

0 comments on commit 497191b

Please sign in to comment.