Skip to content

Commit c51e076

Browse files
author
wonder
committed
Don't forget to add new point to undo stack.
git-svn-id: http://svn.osgeo.org/qgis/trunk@10923 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent d080101 commit c51e076

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/app/qgsmaptooladdfeature.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -175,13 +175,16 @@ void QgsMapToolAddFeature::canvasReleaseEvent( QMouseEvent * e )
175175
f->addAttribute( it.key(), provider->defaultValue( it.key() ) );
176176
}
177177

178+
vlayer->beginEditCommand( tr("Feature added") );
179+
178180
// show the dialog to enter attribute values
179181
QSettings settings;
180182
bool isDisabledAttributeValuesDlg = settings.value( "/qgis/digitizing/disable_enter_attribute_values_dialog", false ).toBool();
181183
if ( isDisabledAttributeValuesDlg )
182184
{
183185
QgsDebugMsg( "Adding feature to layer" );
184186
vlayer->addFeature( *f );
187+
vlayer->endEditCommand();
185188
}
186189
else
187190
{
@@ -190,14 +193,17 @@ void QgsMapToolAddFeature::canvasReleaseEvent( QMouseEvent * e )
190193
{
191194
QgsDebugMsg( "Adding feature to layer" );
192195
vlayer->addFeature( *f );
196+
vlayer->endEditCommand();
193197
}
194198
else
195199
{
200+
vlayer->destroyEditCommand();
196201
QgsDebugMsg( "Adding feature to layer failed" );
197202
delete f;
198203
}
199204
delete mypDialog;
200205
}
206+
201207
mCanvas->refresh();
202208
}
203209

0 commit comments

Comments
 (0)