Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Jan 5, 2022
1 parent f1a196b commit c6fd773
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/app/qgsapplayertreeviewmenuprovider.cpp
Expand Up @@ -131,7 +131,7 @@ QMenu *QgsAppLayerTreeViewMenuProvider::createContextMenu()

menu->addSeparator();

if ( mView->selectedNodes( true ).count() >= 1 )
if ( !mView->selectedNodes( true ).empty() )
menu->addAction( actions->actionGroupSelected( menu ) );

if ( QgisApp::instance()->clipboard()->hasFormat( QGSCLIPBOARD_STYLE_MIME ) )
Expand Down
4 changes: 2 additions & 2 deletions src/gui/layertree/qgslayertreeviewdefaultactions.cpp
Expand Up @@ -240,7 +240,7 @@ void QgsLayerTreeViewDefaultActions::checkAndAllParents()

void QgsLayerTreeViewDefaultActions::addGroup()
{
if ( mView->selectedNodes( true ).count() >= 1 )
if ( !mView->selectedNodes( true ).empty() )
{
groupSelected();
return;
Expand Down Expand Up @@ -511,7 +511,7 @@ void QgsLayerTreeViewDefaultActions::moveToBottom()
void QgsLayerTreeViewDefaultActions::groupSelected()
{
const QList<QgsLayerTreeNode *> nodes = mView->selectedNodes( true );
if ( nodes.count() < 1 || ! QgsLayerTree::isGroup( nodes[0]->parent() ) )
if ( nodes.empty() || ! QgsLayerTree::isGroup( nodes[0]->parent() ) )
return;

QgsLayerTreeGroup *parentGroup = QgsLayerTree::toGroup( nodes[0]->parent() );
Expand Down

0 comments on commit c6fd773

Please sign in to comment.