qt5base-lts/tests/auto/corelib
Albert Astals Cid 78e92997ed 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>
2018-03-02 09:52:14 +00:00
..
animation qtbase: cleanup BLACKLIST files 2018-02-13 15:20:33 +00:00
codecs Replace Q_DECL_OVERRIDE with override where possible 2017-09-19 11:53:42 +00:00
global Fix thread_local test 2018-02-23 13:23:01 +00:00
io qsettings: add Advapi32 lib to Windows ICC builds 2018-02-15 22:02:24 +00:00
itemmodels QListWidgetItem/QStandardItem: pass role to dataChanged() signal 2018-01-26 19:58:26 +00:00
kernel qmetatype: add '-bigobj' flag to Windows ICC builds 2018-02-15 22:02:27 +00:00
mimetypes QMimeDatabase: fix regression in alias resolving 2018-02-28 22:17:58 +00:00
plugin tst_QLibrary: Ensure installation order of testdata libs 2018-03-02 07:20:04 +00:00
serialization JSON: remove braces from UUID text representations 2018-03-02 04:06:33 +00:00
statemachine Fix crash in tst_QStateMachine::dontProcessSlotsWhenMachineIsNotRunning 2018-02-14 08:12:20 +00:00
thread Tests: Raise minimum supported MSVC version to 2015 2018-01-04 20:23:25 +00:00
tools QLocale: Update the system private on QLocale default constructor if needed 2018-03-02 09:52:14 +00:00
corelib.pro Create corelib/serialization and move existing file formats into it 2018-01-26 20:59:50 +00:00