Skip to content

Commit

Permalink
Apply suggestion from review
Browse files Browse the repository at this point in the history
  • Loading branch information
YoannQDQ committed Dec 18, 2024
1 parent c11bb42 commit 8acedae
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions src/gui/qgsshortcutsmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -375,16 +375,8 @@ void QgsShortcutsManager::updateActionToolTip( QAction *action, const QString &s
if ( current.lastIndexOf( rx, -1, &match ) != -1 )
{
// Check if it is a valid QKeySequence
bool validSequence = true;
for ( const QString &part : QKeySequence( match.captured( 1 ) ).toString().split( "," ) )
{
if ( part.trimmed().isEmpty() )
{
validSequence = false;
break;
}
}
if ( validSequence )
const QStringList parts = QKeySequence( match.captured( 1 ) ).toString().split( "," );
if ( std::all_of( parts.constBegin(), parts.constEnd(), []( const QString &part ) { return !part.trimmed().isEmpty(); } ) )
{
current = current.remove( match.capturedStart( 0 ), match.capturedLength( 0 ) );
}
Expand Down

0 comments on commit 8acedae

Please sign in to comment.