@@ -7451,23 +7451,23 @@ void QgisApp::setupLayoutManagerConnections()
7451
7451
7452
7452
void QgisApp::setupDuplicateFeaturesAction ()
7453
7453
{
7454
- QgsMapLayerAction *action = new QgsMapLayerAction ( QString ( tr ( " Duplicate feature" ) ),
7455
- this , QgsMapLayerAction::AllActions ,
7456
- QgsApplication::getThemeIcon ( QStringLiteral ( " /mActionDuplicateFeature.svg" ) ) );
7454
+ mDuplicateFeatureAction . reset ( new QgsMapLayerAction ( tr ( " Duplicate feature" ),
7455
+ nullptr , QgsMapLayerAction::SingleFeature ,
7456
+ QgsApplication::getThemeIcon ( QStringLiteral ( " /mActionDuplicateFeature.svg" ) ) ) );
7457
7457
7458
- QgsGui::mapLayerActionRegistry ()->addMapLayerAction ( action );
7459
- connect ( action , &QgsMapLayerAction::triggeredForFeature, this , [this ]( QgsMapLayer * layer, const QgsFeature & feat )
7458
+ QgsGui::mapLayerActionRegistry ()->addMapLayerAction ( mDuplicateFeatureAction . get () );
7459
+ connect ( mDuplicateFeatureAction . get () , &QgsMapLayerAction::triggeredForFeature, this , [this ]( QgsMapLayer * layer, const QgsFeature & feat )
7460
7460
{
7461
7461
duplicateFeatures ( layer, feat );
7462
7462
}
7463
7463
);
7464
7464
7465
- action = new QgsMapLayerAction ( QString ( tr ( " Duplicate feature and digitize" ) ),
7466
- this , QgsMapLayerAction::AllActions ,
7467
- QgsApplication::getThemeIcon ( QStringLiteral ( " /mActionDuplicateFeatureDigitized.svg" ) ) );
7465
+ mDuplicateFeatureDigitizeAction . reset ( new QgsMapLayerAction ( tr ( " Duplicate feature and digitize" ),
7466
+ nullptr , QgsMapLayerAction::SingleFeature ,
7467
+ QgsApplication::getThemeIcon ( QStringLiteral ( " /mActionDuplicateFeatureDigitized.svg" ) ) ) );
7468
7468
7469
- QgsGui::mapLayerActionRegistry ()->addMapLayerAction ( action );
7470
- connect ( action , &QgsMapLayerAction::triggeredForFeature, this , [this ]( QgsMapLayer * layer, const QgsFeature & feat )
7469
+ QgsGui::mapLayerActionRegistry ()->addMapLayerAction ( mDuplicateFeatureDigitizeAction . get () );
7470
+ connect ( mDuplicateFeatureDigitizeAction . get () , &QgsMapLayerAction::triggeredForFeature, this , [this ]( QgsMapLayer * layer, const QgsFeature & feat )
7471
7471
{
7472
7472
duplicateFeatureDigitized ( layer, feat );
7473
7473
}
0 commit comments