From e9dbc016e133e881ffb4d9994735c15c96699e0f Mon Sep 17 00:00:00 2001 From: David Faure Date: Wed, 12 Mar 2025 13:04:15 +0100 Subject: [PATCH] Use u' ' instead of QLatin1Char(' ') in qkeysequence.cpp Easier on the eye. Amends ada885dfd55d5c386d04039babee43e49ccab5c5. Pick-to: 6.9 6.8 Change-Id: Id218288ccc4556abb7c9a199f27b7dcb6a3ba73e Reviewed-by: Marc Mutz --- src/gui/kernel/qkeysequence.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gui/kernel/qkeysequence.cpp b/src/gui/kernel/qkeysequence.cpp index b9d2855fecf..c7b6e4ebff3 100644 --- a/src/gui/kernel/qkeysequence.cpp +++ b/src/gui/kernel/qkeysequence.cpp @@ -1107,7 +1107,7 @@ QKeyCombination QKeySequencePrivate::decodeString(QString accel, QKeySequence::S qsizetype lastI = 0; while ((i = sl.indexOf(u'+', i + 1)) != -1) { QStringView sub = QStringView{ sl }.mid(lastI, i - lastI + 1); - while (sub.size() > 1 && sub.at(0) == QLatin1Char(' ')) { + while (sub.size() > 1 && sub.at(0) == u' ') { sub = sub.mid(1); ++lastI; } @@ -1143,7 +1143,7 @@ QKeyCombination QKeySequencePrivate::decodeString(QString accel, QKeySequence::S if (!validModifier) { // Try harder with slower code that trims spaces - const QString cleanedSub = sub.toString().remove(QLatin1Char(' ')); + const QString cleanedSub = sub.toString().remove(u' '); validModifier = identifyModifier(cleanedSub); } if (!validModifier) @@ -1157,9 +1157,9 @@ QKeyCombination QKeySequencePrivate::decodeString(QString accel, QKeySequence::S if (p > 0) accelRef = accelRef.mid(p + 1); - while (accelRef.size() > 1 && accelRef.at(0) == QLatin1Char(' ')) + while (accelRef.size() > 1 && accelRef.at(0) == u' ') accelRef = accelRef.mid(1); - while (accelRef.size() > 1 && accelRef.endsWith(QLatin1Char(' '))) + while (accelRef.size() > 1 && accelRef.endsWith(u' ')) accelRef.chop(1); int fnum = 0;