diff options
author | Ivan Solovev <ivan.solovev@qt.io> | 2021-09-06 14:14:35 +0200 |
---|---|---|
committer | Ivan Solovev <ivan.solovev@qt.io> | 2021-09-15 10:29:50 +0200 |
commit | 05d336620cf87fbffc07f2df15e1ba5aeea7ef71 (patch) | |
tree | 1991ea757437556e3dfeb176b8db833587559f1a /src/corelib/text/qlocale.cpp | |
parent | 21dd9b96a57846f916ed9654d93bbfdb89b1c1a8 (diff) |
Fix system locale instantiation
Construction of the static QLocalePrivate called defaultIndex()
and systemData() in an implementation-dependent order, but
defaultIndex() needs to be called after systemData().
So move the systemData() call that's used to ensure it all stays
up to date to before the static initializer.
Pick-to: 6.2
Change-Id: I801b678c01b4e4ddd4de16e9aead7167ec4477f3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'src/corelib/text/qlocale.cpp')
-rw-r--r-- | src/corelib/text/qlocale.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/text/qlocale.cpp b/src/corelib/text/qlocale.cpp index 2a4b65a81f..8ff896b0c5 100644 --- a/src/corelib/text/qlocale.cpp +++ b/src/corelib/text/qlocale.cpp @@ -2650,8 +2650,8 @@ QString QLocale::toString(double f, char format, int precision) const QLocale QLocale::system() { + QT_PREPEND_NAMESPACE(systemData)(); // Ensure system data is up to date. static QLocalePrivate locale(systemData(), defaultIndex(), DefaultNumberOptions, 1); - QT_PREPEND_NAMESPACE(systemData)(); // trigger updating of the system data if necessary return QLocale(locale); } |