@@ -942,7 +942,7 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, bool skipVersionCh
942
942
943
943
activateDeactivateLayerRelatedActions ( nullptr ); // after members were created
944
944
945
- connect ( QgsMapLayerActionRegistry::instance (), &QgsMapLayerActionRegistry::changed, this , &QgisApp::refreshActionFeatureAction );
945
+ connect ( QgsGui::mapLayerActionRegistry (), &QgsMapLayerActionRegistry::changed, this , &QgisApp::refreshActionFeatureAction );
946
946
947
947
// set application's caption
948
948
QString caption = tr ( " QGIS - %1 ('%2')" ).arg ( Qgis::QGIS_VERSION, Qgis::QGIS_RELEASE_NAME );
@@ -6288,7 +6288,7 @@ void QgisApp::updateDefaultFeatureAction( QAction *action )
6288
6288
if ( qgsAction.isValid () )
6289
6289
{
6290
6290
vlayer->actions ()->setDefaultAction ( QStringLiteral ( " Canvas" ), qgsAction.id () );
6291
- QgsMapLayerActionRegistry::instance ()->setDefaultActionForLayer ( vlayer, nullptr );
6291
+ QgsGui::mapLayerActionRegistry ()->setDefaultActionForLayer ( vlayer, nullptr );
6292
6292
6293
6293
mActionFeatureAction ->setToolTip ( tr ( " Run feature action<br><b>%1</b>" ).arg ( qgsAction.name () ) );
6294
6294
@@ -6303,7 +6303,7 @@ void QgisApp::updateDefaultFeatureAction( QAction *action )
6303
6303
QgsMapLayerAction *mapLayerAction = qobject_cast<QgsMapLayerAction *>( action );
6304
6304
if ( mapLayerAction )
6305
6305
{
6306
- QgsMapLayerActionRegistry::instance ()->setDefaultActionForLayer ( vlayer, mapLayerAction );
6306
+ QgsGui::mapLayerActionRegistry ()->setDefaultActionForLayer ( vlayer, mapLayerAction );
6307
6307
6308
6308
if ( !mapLayerAction->text ().isEmpty () )
6309
6309
mActionFeatureAction ->setToolTip ( tr ( " Run feature action<br><b>%1</b>" ).arg ( mapLayerAction->text () ) );
@@ -6313,7 +6313,7 @@ void QgisApp::updateDefaultFeatureAction( QAction *action )
6313
6313
}
6314
6314
else
6315
6315
{
6316
- QgsMapLayerActionRegistry::instance ()->setDefaultActionForLayer ( vlayer, nullptr );
6316
+ QgsGui::mapLayerActionRegistry ()->setDefaultActionForLayer ( vlayer, nullptr );
6317
6317
}
6318
6318
}
6319
6319
}
@@ -6340,7 +6340,7 @@ void QgisApp::refreshFeatureActions()
6340
6340
}
6341
6341
6342
6342
// add actions registered in QgsMapLayerActionRegistry
6343
- QList<QgsMapLayerAction *> registeredActions = QgsMapLayerActionRegistry::instance ()->mapLayerActions ( vlayer );
6343
+ QList<QgsMapLayerAction *> registeredActions = QgsGui::mapLayerActionRegistry ()->mapLayerActions ( vlayer );
6344
6344
if ( !actions.isEmpty () && registeredActions.size () > 0 )
6345
6345
{
6346
6346
// add a separator between user defined and standard actions
@@ -6350,7 +6350,7 @@ void QgisApp::refreshFeatureActions()
6350
6350
for ( int i = 0 ; i < registeredActions.size (); i++ )
6351
6351
{
6352
6352
mFeatureActionMenu ->addAction ( registeredActions.at ( i ) );
6353
- if ( registeredActions.at ( i ) == QgsMapLayerActionRegistry::instance ()->defaultActionForLayer ( vlayer ) )
6353
+ if ( registeredActions.at ( i ) == QgsGui::mapLayerActionRegistry ()->defaultActionForLayer ( vlayer ) )
6354
6354
{
6355
6355
mFeatureActionMenu ->setActiveAction ( registeredActions.at ( i ) );
6356
6356
}
@@ -7296,7 +7296,7 @@ void QgisApp::setupLayoutManagerConnections()
7296
7296
QgsMapLayerAction *action = mAtlasFeatureActions .value ( c );
7297
7297
if ( action )
7298
7298
{
7299
- QgsMapLayerActionRegistry::instance ()->removeMapLayerAction ( action );
7299
+ QgsGui::mapLayerActionRegistry ()->removeMapLayerAction ( action );
7300
7300
delete action;
7301
7301
mAtlasFeatureActions .remove ( c );
7302
7302
}
@@ -7309,7 +7309,7 @@ void QgisApp::setupAtlasMapLayerAction( QgsComposition *composition, bool enable
7309
7309
QgsMapLayerAction *action = mAtlasFeatureActions .value ( composition );
7310
7310
if ( action )
7311
7311
{
7312
- QgsMapLayerActionRegistry::instance ()->removeMapLayerAction ( action );
7312
+ QgsGui::mapLayerActionRegistry ()->removeMapLayerAction ( action );
7313
7313
delete action;
7314
7314
action = nullptr ;
7315
7315
mAtlasFeatureActions .remove ( composition );
@@ -7321,7 +7321,7 @@ void QgisApp::setupAtlasMapLayerAction( QgsComposition *composition, bool enable
7321
7321
this , composition->atlasComposition ().coverageLayer (), QgsMapLayerAction::SingleFeature,
7322
7322
QgsApplication::getThemeIcon ( QStringLiteral ( " /mIconAtlas.svg" ) ) );
7323
7323
mAtlasFeatureActions .insert ( composition, action );
7324
- QgsMapLayerActionRegistry::instance ()->addMapLayerAction ( action );
7324
+ QgsGui::mapLayerActionRegistry ()->addMapLayerAction ( action );
7325
7325
connect ( action, &QgsMapLayerAction::triggeredForFeature, this , [this , composition]( QgsMapLayer * layer, const QgsFeature & feat )
7326
7326
{
7327
7327
setCompositionAtlasFeature ( composition, layer, feat );
@@ -11160,7 +11160,7 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer *layer )
11160
11160
11161
11161
bool isEditable = vlayer->isEditable ();
11162
11162
bool layerHasSelection = vlayer->selectedFeatureCount () > 0 ;
11163
- bool layerHasActions = !vlayer->actions ()->actions ( QStringLiteral ( " Canvas" ) ).isEmpty () || !QgsMapLayerActionRegistry::instance ()->mapLayerActions ( vlayer ).isEmpty ();
11163
+ bool layerHasActions = !vlayer->actions ()->actions ( QStringLiteral ( " Canvas" ) ).isEmpty () || !QgsGui::mapLayerActionRegistry ()->mapLayerActions ( vlayer ).isEmpty ();
11164
11164
bool isSpatial = vlayer->isSpatial ();
11165
11165
11166
11166
mActionLocalHistogramStretch ->setEnabled ( false );
@@ -11458,7 +11458,7 @@ void QgisApp::refreshActionFeatureAction()
11458
11458
if ( !vlayer )
11459
11459
return ;
11460
11460
11461
- bool layerHasActions = !vlayer->actions ()->actions ( QStringLiteral ( " Canvas" ) ).isEmpty () || !QgsMapLayerActionRegistry::instance ()->mapLayerActions ( vlayer ).isEmpty ();
11461
+ bool layerHasActions = !vlayer->actions ()->actions ( QStringLiteral ( " Canvas" ) ).isEmpty () || !QgsGui::mapLayerActionRegistry ()->mapLayerActions ( vlayer ).isEmpty ();
11462
11462
mActionFeatureAction ->setEnabled ( layerHasActions );
11463
11463
}
11464
11464
0 commit comments