@@ -7451,23 +7451,23 @@ void QgisApp::setupLayoutManagerConnections()
74517451
74527452void QgisApp::setupDuplicateFeaturesAction ()
74537453{
7454- QgsMapLayerAction *action = new QgsMapLayerAction ( QString ( tr ( " Duplicate feature" ) ),
7455- this , QgsMapLayerAction::AllActions,
7456- QgsApplication::getThemeIcon ( QStringLiteral ( " /mActionDuplicateFeature.svg" ) ) );
7454+ mDuplicateFeatureAction . reset ( new QgsMapLayerAction ( QString ( tr ( " Duplicate feature" ) ),
7455+ this , QgsMapLayerAction::AllActions,
7456+ QgsApplication::getThemeIcon ( QStringLiteral ( " /mActionDuplicateFeature.svg" ) ) ) );
74577457
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 )
74607460 {
74617461 duplicateFeatures ( layer, feat );
74627462 }
74637463 );
74647464
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 ( QString ( tr ( " Duplicate feature and digitize" ) ),
7466+ this , QgsMapLayerAction::AllActions,
7467+ QgsApplication::getThemeIcon ( QStringLiteral ( " /mActionDuplicateFeatureDigitized.svg" ) ) ) );
74687468
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 )
74717471 {
74727472 duplicateFeatureDigitized ( layer, feat );
74737473 }
0 commit comments