20 : QAction( icon, name, parent )
21 , mSingleLayer( false )
23 , mSpecificLayerType( false )
31 : QAction( icon, name, parent )
32 , mSingleLayer( true )
33 , mActionLayer( layer )
34 , mSpecificLayerType( false )
42 : QAction( icon, name, parent )
43 , mSingleLayer( false )
45 , mSpecificLayerType( true )
46 , mLayerType( layerType )
60 if ( !mSingleLayer && !mSpecificLayerType )
66 if ( mSingleLayer && layer == mActionLayer )
71 else if ( mSpecificLayerType && layer->
type() == mLayerType )
101 if ( mInstance == 0 )
130 QList< QgsMapLayerAction* > validActions;
131 QList<QgsMapLayerAction*>::iterator actionIt;
134 if (( *actionIt )->canRunUsingLayer( layer ) && ( targets & ( *actionIt )->targets() ) )
136 validActions.append(( *actionIt ) );
150 QMap<QgsMapLayer*, QgsMapLayerAction*>::iterator defaultIt;
151 for ( defaultIt = mDefaultLayerActionMap.begin(); defaultIt != mDefaultLayerActionMap.end(); ++defaultIt )
153 if ( defaultIt.value() == action )
155 defaultIt.value() = 0;
167 mDefaultLayerActionMap[ layer ] = action;
172 if ( !mDefaultLayerActionMap.contains( layer ) )
177 return mDefaultLayerActionMap[ layer ];