Skip to content
Permalink
Browse files

use reference for fids in deleteFeatures and ensure that they exist u…

…ntil the end in qgsrelationeditorwidget
  • Loading branch information
signedav committed May 14, 2020
1 parent 66a5dbf commit b9348302c44bc9daa5be68a2161e84b23e1ee98d
@@ -1974,7 +1974,7 @@ Deletes a feature from the layer (but does not commit it).
changes can be discarded by calling rollBack().
%End

bool deleteFeatures( const QgsFeatureIds fids, DeleteContext *context = 0 );
bool deleteFeatures( const QgsFeatureIds &fids, DeleteContext *context = 0 );
%Docstring
Deletes a set of features from the layer (but does not commit it)

@@ -3240,7 +3240,7 @@ bool QgsVectorLayer::deleteFeature( QgsFeatureId fid, QgsVectorLayer::DeleteCont
return res;
}

bool QgsVectorLayer::deleteFeatures( const QgsFeatureIds fids, QgsVectorLayer::DeleteContext *context )
bool QgsVectorLayer::deleteFeatures( const QgsFeatureIds &fids, QgsVectorLayer::DeleteContext *context )
{
bool res = true;
const auto constFids = fids;
@@ -1858,7 +1858,7 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer, public QgsExpressionConte
* to the underlying data provider until a commitChanges() call is made. Any uncommitted
* changes can be discarded by calling rollBack().
*/
bool deleteFeatures( const QgsFeatureIds fids, DeleteContext *context = nullptr );
bool deleteFeatures( const QgsFeatureIds &fids, DeleteContext *context = nullptr );

/**
* Attempts to commit to the underlying data provider any buffered changes made since the
@@ -652,7 +652,8 @@ void QgsRelationEditorWidget::deleteFeature( const QgsFeatureId featureid )

void QgsRelationEditorWidget::deleteSelectedFeatures()
{
deleteFeatures( mFeatureSelectionMgr->selectedFeatureIds() );
QgsFeatureIds selectedFids = mFeatureSelectionMgr->selectedFeatureIds();
deleteFeatures( selectedFids );
}

void QgsRelationEditorWidget::deleteFeatures( const QgsFeatureIds &featureids )

0 comments on commit b934830

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