Skip to content
Permalink
Browse files

[QgsQuick] Clean feature layer pair after deleting feature.

  • Loading branch information
vsklencar authored and wonder-sk committed Aug 21, 2020
1 parent 01f8b62 commit 2f0c935d77e1ecdac2e9dd910501c537342aba96
Showing with 9 additions and 3 deletions.
  1. +9 −3 src/quickgui/attributes/qgsquickattributemodel.cpp
@@ -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;
}

0 comments on commit 2f0c935

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