From 837a29b0b92c72b7b9d66a427c24a9fa8037f4f4 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Fri, 6 Nov 2020 11:53:27 +0100 Subject: [PATCH] Fix accidental shadowing in QLocale::uiLanguages() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 b5bc3ee036575dd5a3eec1d6bd578738df7bd6ad. Fixes: QTBUG-87858 Change-Id: I6bd64aef1eb7df9ec4a703c59aa7369245ab2472 Reviewed-by: MÃ¥rten Nordheim --- src/corelib/text/qlocale.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/text/qlocale.cpp b/src/corelib/text/qlocale.cpp index 55de69998b..b751ed4579 100644 --- a/src/corelib/text/qlocale.cpp +++ b/src/corelib/text/qlocale.cpp @@ -4195,7 +4195,7 @@ QStringList QLocale::uiLanguages() const QList 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));