21 : QAction( icon, name, parent )
28 : QAction( icon, name, parent )
29 , mSingleLayer( true )
30 , mActionLayer( layer )
37 : QAction( icon, name, parent )
38 , mSpecificLayerType( true )
39 , mLayerType( layerType )
65 if ( !qobject_cast<QgsVectorLayer *>( layer )->isEditable() )
70 if ( !mSingleLayer && !mSpecificLayerType )
76 if ( mSingleLayer && layer == mActionLayer )
81 else if ( mSpecificLayerType && layer && layer->
type() == mLayerType )
127 QList< QgsMapLayerAction * > validActions;
132 if ( action->canRunUsingLayer( layer ) && ( targets & action->targets() ) )
134 validActions.append( action );
148 QMap<QgsMapLayer *, QgsMapLayerAction *>::iterator defaultIt;
149 for ( defaultIt = mDefaultLayerActionMap.begin(); defaultIt != mDefaultLayerActionMap.end(); ++defaultIt )
151 if ( defaultIt.value() == action )
153 defaultIt.value() =
nullptr;
165 mDefaultLayerActionMap[ layer ] = action;
170 if ( !mDefaultLayerActionMap.contains( layer ) )
175 return mDefaultLayerActionMap[ layer ];