Skip to content

Commit 2bedaf8

Browse files
committedJan 21, 2017
Don't show prompt on empty group
1 parent 72551fb commit 2bedaf8

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed
 

‎src/app/qgisapp.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8502,6 +8502,15 @@ void QgisApp::removeLayer()
85028502
}
85038503

85048504
bool promptConfirmation = QSettings().value( QStringLiteral( "qgis/askToDeleteLayers" ), true ).toBool();
8505+
8506+
// Don't show prompt to remove a empty group.
8507+
if ( selectedNodes.count() == 1
8508+
&& selectedNodes.at( 0 )->nodeType() == QgsLayerTreeNode::NodeGroup
8509+
&& selectedNodes.at( 0 )->children().count() == 0 )
8510+
{
8511+
promptConfirmation = false;
8512+
}
8513+
85058514
bool shiftHeld = QApplication::queryKeyboardModifiers().testFlag( Qt::ShiftModifier );
85068515
//display a warning
85078516
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 commit comments

Comments
 (0)
Please sign in to comment.