summaryrefslogtreecommitdiffstats
path: root/src/corelib/time
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2020-09-16 16:29:54 +0200
committerEdward Welbourne <edward.welbourne@qt.io>2020-09-30 16:41:39 +0200
commit10cb65fbf6e5bb8c393b399ae1367c8da2d595e3 (patch)
tree89155d7cc539a8f51f52b58a436c97d8fd8d764c /src/corelib/time
parent61bd6afe39e20e1fa2ddfebce4ca43d5a54df664 (diff)
Use QDateTimeParser::locale(), not the default QLocale
QDateTimeParser::parseSection() used the default locale instead of the one configured. Change-Id: Ie31aa87670cc5ceaf8d937a907807445f44bf7f9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Andreas Buhr <andreas.buhr@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Diffstat (limited to 'src/corelib/time')
-rw-r--r--src/corelib/time/qdatetimeparser.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/corelib/time/qdatetimeparser.cpp b/src/corelib/time/qdatetimeparser.cpp
index eb495318a1..13dd4793bf 100644
--- a/src/corelib/time/qdatetimeparser.cpp
+++ b/src/corelib/time/qdatetimeparser.cpp
@@ -817,7 +817,7 @@ QDateTimeParser::parseSection(const QDateTime &currentValue, int sectionIndex, i
}
const int absMax = absoluteMax(sectionIndex);
- QLocale loc;
+ const QLocale loc = locale();
bool ok = true;
int last = -1, used = -1;
@@ -825,7 +825,7 @@ QDateTimeParser::parseSection(const QDateTime &currentValue, int sectionIndex, i
QStringView digitsStr = sectionTextRef.left(sectiontextSize);
for (int digits = sectiontextSize; digits >= 1; --digits) {
digitsStr.truncate(digits);
- int tmp = (int)loc.toUInt(digitsStr, &ok);
+ int tmp = int(loc.toUInt(digitsStr, &ok));
if (ok && sn.type == Hour12Section) {
if (tmp > 12) {
tmp = -1;