diff options
author | Edward Welbourne <edward.welbourne@qt.io> | 2021-04-29 18:57:49 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@qt.io> | 2022-01-18 20:42:19 +0000 |
commit | 7fea7dfaf3c2a1ee335ef60fd4d7f7803673f3a7 (patch) | |
tree | a9b5e41b20ddd1a2744a7640d7b7ea55b45a2662 | |
parent | 7e82cefb728df14e889334dcf26f13fd8a616a14 (diff) |
Restore std::as_const() where a qAsConst was lost between 5.15 and 6
Amends commit 837a29b0b92c72b7b9d66a427c24a9fa8037f4f4's fix for
shadowing to take account of the loss of const-qualification of
uiLanguages where it was then used in a ranged-for loop.
Pick-to: 6.3 6.2
Change-Id: Ic4021bd9917cb27832a197126cc80a7f384a14a2
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
-rw-r--r-- | src/corelib/text/qlocale.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/corelib/text/qlocale.cpp b/src/corelib/text/qlocale.cpp index eb180388a1..26087ffd83 100644 --- a/src/corelib/text/qlocale.cpp +++ b/src/corelib/text/qlocale.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2021 The Qt Company Ltd. +** Copyright (C) 2022 The Qt Company Ltd. ** Copyright (C) 2021 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** @@ -4458,7 +4458,7 @@ QStringList QLocale::uiLanguages() const if (d->m_data == &systemLocaleData) { uiLanguages = systemLocale()->query(QSystemLocale::UILanguages).toStringList(); // ... but we need to include likely-adjusted forms of each of those, too: - for (const auto &entry : uiLanguages) + for (const auto &entry : std::as_const(uiLanguages)) locales.append(QLocale(entry)); if (locales.isEmpty()) locales.append(systemLocale()->fallbackLocale()); |