diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2020-05-11 09:35:08 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2020-05-11 12:47:01 +0200 |
commit | 3bc9f357714ab7e59cbdf28d0b449d3069dea401 (patch) | |
tree | 55abb7d84aabcc1627e0fe09d520ad40334a68a7 /src/corelib/io | |
parent | 20f3ec461dc2a4c980df53a637663ba8fe64fdaf (diff) |
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>
Diffstat (limited to 'src/corelib/io')
-rw-r--r-- | src/corelib/io/qsettings.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/corelib/io/qsettings.cpp b/src/corelib/io/qsettings.cpp index 6840b9686c..c9122e5962 100644 --- a/src/corelib/io/qsettings.cpp +++ b/src/corelib/io/qsettings.cpp @@ -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 |