Skip to content
Permalink
Browse files
Updated indentation
  • Loading branch information
wonder-sk committed May 23, 2014
1 parent 189707f commit 45d0a9cfca30155ef53b441ec149feea955092ba
Showing with 18 additions and 18 deletions.
  1. +6 −6 src/app/legend/qgsapplegendinterface.cpp
  2. +12 −12 src/app/qgsapplayertreeviewmenuprovider.cpp
@@ -302,26 +302,26 @@ void QgsAppLegendInterface::onRemovedChildren()
void QgsAppLegendInterface::addLegendLayerAction( QAction* action,
QString menu, QString id, QgsMapLayer::LayerType type, bool allLayers )
{
QgsAppLayerTreeViewMenuProvider* menuProvider = dynamic_cast<QgsAppLayerTreeViewMenuProvider*>(mLayerTreeView->menuProvider());
if (!menuProvider)
QgsAppLayerTreeViewMenuProvider* menuProvider = dynamic_cast<QgsAppLayerTreeViewMenuProvider*>( mLayerTreeView->menuProvider() );
if ( !menuProvider )
return;

menuProvider->addLegendLayerAction( action, menu, id, type, allLayers );
}

void QgsAppLegendInterface::addLegendLayerActionForLayer( QAction* action, QgsMapLayer* layer )
{
QgsAppLayerTreeViewMenuProvider* menuProvider = dynamic_cast<QgsAppLayerTreeViewMenuProvider*>(mLayerTreeView->menuProvider());
if (!menuProvider)
QgsAppLayerTreeViewMenuProvider* menuProvider = dynamic_cast<QgsAppLayerTreeViewMenuProvider*>( mLayerTreeView->menuProvider() );
if ( !menuProvider )
return;

menuProvider->addLegendLayerActionForLayer( action, layer );
}

bool QgsAppLegendInterface::removeLegendLayerAction( QAction* action )
{
QgsAppLayerTreeViewMenuProvider* menuProvider = dynamic_cast<QgsAppLayerTreeViewMenuProvider*>(mLayerTreeView->menuProvider());
if (!menuProvider)
QgsAppLayerTreeViewMenuProvider* menuProvider = dynamic_cast<QgsAppLayerTreeViewMenuProvider*>( mLayerTreeView->menuProvider() );
if ( !menuProvider )
return false;

menuProvider->removeLegendLayerAction( action );
@@ -238,7 +238,7 @@ QMenu* QgsAppLayerTreeViewMenuProvider::createContextMenu()


void QgsAppLayerTreeViewMenuProvider::addLegendLayerAction( QAction* action, QString menu, QString id,
QgsMapLayer::LayerType type, bool allLayers )
QgsMapLayer::LayerType type, bool allLayers )
{
mLegendLayerActionMap[type].append( LegendLayerAction( action, menu, id, allLayers ) );
}
@@ -271,11 +271,11 @@ void QgsAppLayerTreeViewMenuProvider::addLegendLayerActionForLayer( QAction* act
= mLegendLayerActionMap.find( layer->type() );
for ( int i = 0; i < it->count(); i++ )
{
if ( ( *it )[i].action == action )
{
( *it )[i].layers.append( layer );
return;
}
if (( *it )[i].action == action )
{
( *it )[i].layers.append( layer );
return;
}
}
}

@@ -288,7 +288,7 @@ void QgsAppLayerTreeViewMenuProvider::removeLegendLayerActionsForLayer( QgsMapLa
= mLegendLayerActionMap.find( layer->type() );
for ( int i = 0; i < it->count(); i++ )
{
( *it )[i].layers.removeAll( layer );
( *it )[i].layers.removeAll( layer );
}
}

@@ -297,12 +297,12 @@ QList< LegendLayerAction > QgsAppLayerTreeViewMenuProvider::legendLayerActions(
#ifdef QGISDEBUG
if ( mLegendLayerActionMap.contains( type ) )
{
QgsDebugMsg( QString("legendLayerActions for layers of type %1:").arg( type ) );
QgsDebugMsg( QString( "legendLayerActions for layers of type %1:" ).arg( type ) );

foreach ( LegendLayerAction lyrAction, mLegendLayerActionMap[ type ] )
{
QgsDebugMsg( QString("%1/%2 - %3 layers").arg( lyrAction.menu ).arg( lyrAction.action->text() ).arg( lyrAction.layers.count()) );
}
foreach ( LegendLayerAction lyrAction, mLegendLayerActionMap[ type ] )
{
QgsDebugMsg( QString( "%1/%2 - %3 layers" ).arg( lyrAction.menu ).arg( lyrAction.action->text() ).arg( lyrAction.layers.count() ) );
}
}
#endif

0 comments on commit 45d0a9c

Please sign in to comment.