[QgsQuick] Clean feature layer pair after deleting feature.

This commit is contained in:
vsklencar 2020-08-20 10:29:44 +02:00 committed by Martin Dobias
parent 01f8b625c9
commit 2f0c935d77

View File

@ -200,12 +200,18 @@ bool QgsQuickAttributeModel::deleteFeature()
rv = false;
}
if ( !mFeatureLayerPair.layer()->deleteFeature( mFeatureLayerPair.feature().id() ) )
bool isDeleted = mFeatureLayerPair.layer()->deleteFeature( mFeatureLayerPair.feature().id() );
rv = commit();
if ( !isDeleted )
QgsMessageLog::logMessage( tr( "Cannot delete feature" ),
QStringLiteral( "QgsQuick" ),
Qgis::Warning );
rv = commit();
else
{
mFeatureLayerPair = QgsQuickFeatureLayerPair();
emit featureLayerPairChanged();
}
return rv;
}