diff options
author | Albert Astals Cid <albert.astals.cid@kdab.com> | 2018-01-02 10:48:34 +0100 |
---|---|---|
committer | Albert Astals Cid <albert.astals.cid@kdab.com> | 2018-03-02 09:52:14 +0000 |
commit | 78e92997ed35ddc8bb6f7f6c0a4fffba026d5d8f (patch) | |
tree | 664e5e4bfa78c1d07316a18a48e503c197048fc0 /src/corelib/kernel/qdeadlinetimer.h | |
parent | fdddb3a4814f588e3ee87a6c1a0a6791f6ef0298 (diff) |
QLocale: Update the system private on QLocale default constructor if needed
When first starting an Android app we have invocation order issue, to
load the platform plugin we create the default QLocale (needed by the
resource locator code to see if :/qt/etc/qt.conf exists) so when the
android platform plugin loads and creates its own QSystemLocale, the
QLocale defaultLocalePrivate is already created and pointing to
globalLocaleData which means that systemData won't be called and thus
the code that triggers the call to QLocalePrivate::updateSystemPrivate
won't be called when calling QLocale().
I thought of two ways of fixing this, one was calling
QLocalePrivate::updateSystemPrivatea() from the QAndroidSystemLocale
constructor, but giving the responsibility to not break things to the
plugin seems a little fragile, so making the check on QLocale()
seems better.
Without this patch an Android app doing
QApplication app(argc, argv);
qDebug() << QLocale().name();
qDebug() << QLocale().name();
qDebug() << QLocale::system().name();
qDebug() << QLocale().name();
would print
""
""
"ca_ES"
"ca_ES"
now it correctly prints "ca_ES" the four times.
Task-number: QTBUG-41385
Change-Id: I2cf419f59aa008fa3aca11295fe7d42c40bcc32e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'src/corelib/kernel/qdeadlinetimer.h')
0 files changed, 0 insertions, 0 deletions