Skip to content
Permalink
Browse files

use getter of handledFeatures on DeleteContext

  • Loading branch information
signedav committed May 11, 2020
1 parent d6a038b commit fd7edae216a973b2446ee29bf84fa52b2fb0a874
Showing with 12 additions and 12 deletions.
  1. +4 −4 src/app/qgisapp.cpp
  2. +4 −4 src/app/qgsattributetabledialog.cpp
  3. +4 −4 src/gui/qgsrelationeditorwidget.cpp
@@ -9033,15 +9033,15 @@ void QgisApp::deleteSelected( QgsMapLayer *layer, QWidget *parent, bool checkFea
else
{
//if it effected more than one layer, print feedback for all descendants
if ( context.handledFeatures.count() > 1 )
if ( context.handledFeatures().size() > 1 )
{
deletedCount = 0;
QString feedbackMessage;
QMap<QgsVectorLayer *, QgsFeatureIds>::const_iterator i;
for ( i = context.handledFeatures.begin(); i != context.handledFeatures.end(); ++i )
for ( i = context.handledFeatures().begin(); i != context.handledFeatures().end(); ++i )
{
feedbackMessage += tr( " %1 on layer %2." ).arg( i.value().count() ).arg( i.key()->name() );
deletedCount += i.value().count();
feedbackMessage += tr( " %1 on layer %2." ).arg( i.value().size() ).arg( i.key()->name() );
deletedCount += i.value().size();
}
visibleMessageBar()->pushMessage( tr( "%1 features deleted: %2" ).arg( deletedCount ).arg( feedbackMessage ), Qgis::Success );
}
@@ -888,15 +888,15 @@ void QgsAttributeTableDialog::deleteFeature( const QgsFeatureId fid )
QgsVectorLayer::DeleteContext context { true };
mLayer->deleteFeature( fid, &context );
//if it effected more than one layer, print feedback for all descendants
if ( context.handledFeatures.count() > 1 )
if ( context.handledFeatures().size() > 1 )
{
int deletedCount = 0;
QString feedbackMessage;
QMap<QgsVectorLayer *, QgsFeatureIds>::const_iterator i;
for ( i = context.handledFeatures.begin(); i != context.handledFeatures.end(); ++i )
for ( i = context.handledFeatures().begin(); i != context.handledFeatures().end(); ++i )
{
feedbackMessage += tr( " %1 on layer %2." ).arg( i.value().count() ).arg( i.key()->name() );
deletedCount += i.value().count();
feedbackMessage += tr( " %1 on layer %2." ).arg( i.value().size() ).arg( i.key()->name() );
deletedCount += i.value().size();
}
QgisApp::instance()->messageBar()->pushMessage( tr( "%1 features deleted: %2" ).arg( deletedCount ).arg( feedbackMessage ), Qgis::Success );
}
@@ -752,15 +752,15 @@ void QgsRelationEditorWidget::deleteFeatures( const QgsFeatureIds &featureids )
{
QgsVectorLayer::DeleteContext context { true };
layer->deleteFeatures( featureids, &context );
if ( context.handledFeatures.count() > 1 )
if ( context.handledFeatures().size() > 1 )
{
int deletedCount = 0;
QString feedbackMessage;
QMap<QgsVectorLayer *, QgsFeatureIds>::const_iterator i;
for ( i = context.handledFeatures.begin(); i != context.handledFeatures.end(); ++i )
for ( i = context.handledFeatures().begin(); i != context.handledFeatures().end(); ++i )
{
feedbackMessage += tr( " %1 on layer %2." ).arg( i.value().count() ).arg( i.key()->name() );
deletedCount += i.value().count();
feedbackMessage += tr( " %1 on layer %2." ).arg( i.value().size() ).arg( i.key()->name() );
deletedCount += i.value().size();
}
mEditorContext.mainMessageBar()->pushMessage( tr( "%1 features deleted: %2" ).arg( deletedCount ).arg( feedbackMessage ), Qgis::Success );
}

0 comments on commit fd7edae

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