summaryrefslogtreecommitdiffstats
path: root/src/corelib/text/qlocale.cpp
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2020-10-20 11:41:13 +0200
committerEdward Welbourne <edward.welbourne@qt.io>2020-10-28 06:26:01 +0100
commit2c4874be40aa40b698315cac0ad768e5c650a740 (patch)
treeb3d3836372f7a76e8133d9b0f3153c61f604f07e /src/corelib/text/qlocale.cpp
parent2575a8ced39b607ed320ed230c83119eaad4b33b (diff)
Deprecate old aliases for two countries and several languages
[ChangeLog][QtCore][QLocale] Deprecated several Language and Country aliases, ready for removal in Qt 6.0, in favor of their newer names. Task-number: QTBUG-84669 Pick-to: 5.15 5.15.2 Change-Id: Iebaa0a5a77bfa12f7014de53fab4a25b5f1cc92c Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/corelib/text/qlocale.cpp')
-rw-r--r--src/corelib/text/qlocale.cpp24
1 files changed, 8 insertions, 16 deletions
diff --git a/src/corelib/text/qlocale.cpp b/src/corelib/text/qlocale.cpp
index 01278f343c..260af879db 100644
--- a/src/corelib/text/qlocale.cpp
+++ b/src/corelib/text/qlocale.cpp
@@ -115,22 +115,14 @@ QLocale::Language QLocalePrivate::codeToLanguage(QStringView code) noexcept
if (uc3 == 0) {
// legacy codes
- if (uc1 == 'n' && uc2 == 'o') { // no -> nb
- static_assert(QLocale::Norwegian == QLocale::NorwegianBokmal);
- return QLocale::Norwegian;
- }
- if (uc1 == 't' && uc2 == 'l') { // tl -> fil
- static_assert(QLocale::Tagalog == QLocale::Filipino);
- return QLocale::Tagalog;
- }
- if (uc1 == 's' && uc2 == 'h') { // sh -> sr[_Latn]
- static_assert(QLocale::SerboCroatian == QLocale::Serbian);
- return QLocale::SerboCroatian;
- }
- if (uc1 == 'm' && uc2 == 'o') { // mo -> ro
- static_assert(QLocale::Moldavian == QLocale::Romanian);
- return QLocale::Moldavian;
- }
+ if (uc1 == 'n' && uc2 == 'o') // no -> nb
+ return QLocale::NorwegianBokmal;
+ if (uc1 == 't' && uc2 == 'l') // tl -> fil
+ return QLocale::Filipino;
+ if (uc1 == 's' && uc2 == 'h') // sh -> sr[_Latn]
+ return QLocale::Serbian;
+ if (uc1 == 'm' && uc2 == 'o') // mo -> ro
+ return QLocale::Romanian;
// Android uses the following deprecated codes
if (uc1 == 'i' && uc2 == 'w') // iw -> he
return QLocale::Hebrew;