Apply suggestion from review

This commit is contained in:
Yoann Quenach de Quivillic 2024-12-18 18:26:59 +01:00
parent c11bb42cf3
commit 8acedaed61

View File

@ -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 ) );
}