QSettings: port iniUnescapedKey() from int to char16_t

The 'ch' never had to be a 32-bit variable. It only ever gets assigned
16-bit unsigned values, so make it a char16_t and thus implicitly
convertible to QChar, even when QChar(int) is being deprecated or
removed.

Change-Id: I8391c393ca860f8f73f1495d7764dacd57275ea7
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
bb10
Marc Mutz 2020-05-11 09:35:08 +02:00
parent 20f3ec461d
commit 3bc9f35771
1 changed files with 3 additions and 3 deletions

View File

@ -566,7 +566,7 @@ bool QSettingsPrivate::iniUnescapedKey(const QByteArray &key, int from, int to,
int i = from;
result.reserve(result.length() + (to - from));
while (i < to) {
int ch = (uchar)key.at(i);
char16_t ch = (uchar)key.at(i);
if (ch == '\\') {
result += QLatin1Char('/');
@ -577,7 +577,7 @@ bool QSettingsPrivate::iniUnescapedKey(const QByteArray &key, int from, int to,
if (ch != '%' || i == to - 1) {
if (uint(ch - 'A') <= 'Z' - 'A') // only for ASCII
lowercaseOnly = false;
result += QLatin1Char(ch);
result += ch;
++i;
continue;
}
@ -599,7 +599,7 @@ bool QSettingsPrivate::iniUnescapedKey(const QByteArray &key, int from, int to,
}
bool ok;
ch = key.mid(firstDigitPos, numDigits).toInt(&ok, 16);
ch = key.mid(firstDigitPos, numDigits).toUShort(&ok, 16);
if (!ok) {
result += QLatin1Char('%');
// ### missing U