Skip to content
Permalink
Browse files
Don't show prompt on empty group
  • Loading branch information
NathanW2 committed Jan 21, 2017
1 parent 72551fb commit 2bedaf869c639b43a0f0f93f42e20208a79e057c
Showing with 9 additions and 0 deletions.
  1. +9 −0 src/app/qgisapp.cpp
@@ -8502,6 +8502,15 @@ void QgisApp::removeLayer()
}

bool promptConfirmation = QSettings().value( QStringLiteral( "qgis/askToDeleteLayers" ), true ).toBool();

// Don't show prompt to remove a empty group.
if ( selectedNodes.count() == 1
&& selectedNodes.at( 0 )->nodeType() == QgsLayerTreeNode::NodeGroup
&& selectedNodes.at( 0 )->children().count() == 0 )
{
promptConfirmation = false;
}

bool shiftHeld = QApplication::queryKeyboardModifiers().testFlag( Qt::ShiftModifier );
//display a warning
if ( !shiftHeld && promptConfirmation && QMessageBox::warning( this, tr( "Remove layers and groups" ), tr( "Remove %n legend entries?", "number of legend items to remove", selectedNodes.count() ), QMessageBox::Ok | QMessageBox::Cancel ) == QMessageBox::Cancel )

0 comments on commit 2bedaf8

Please sign in to comment.