Fix accidental shadowing in QLocale::uiLanguages()

While simplifying uses of QSystemLocale::query() I declared a
shadowing local variable instead of setting a function-scope variable
that the code had previously set. Restore prior correct behavior.

Fixup for commit b5bc3ee036.

Fixes: QTBUG-87858
Change-Id: I6bd64aef1eb7df9ec4a703c59aa7369245ab2472
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
bb10
Edward Welbourne 2020-11-06 11:53:27 +01:00
parent 07aa91221f
commit 837a29b0b9
1 changed files with 1 additions and 1 deletions

View File

@ -4195,7 +4195,7 @@ QStringList QLocale::uiLanguages() const
QList<QLocale> locales;
#ifndef QT_NO_SYSTEMLOCALE
if (d->m_data == &globalLocaleData) {
const auto uiLanguages = systemLocale()->query(QSystemLocale::UILanguages).toStringList();
uiLanguages = systemLocale()->query(QSystemLocale::UILanguages).toStringList();
// ... but we need to include likely-adjusted forms of each of those, too:
for (const auto &entry : uiLanguages)
locales.append(QLocale(entry));