diff options
author | Edward Welbourne <edward.welbourne@qt.io> | 2020-10-20 11:41:13 +0200 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2020-10-28 06:26:01 +0100 |
commit | 2c4874be40aa40b698315cac0ad768e5c650a740 (patch) | |
tree | b3d3836372f7a76e8133d9b0f3153c61f604f07e /src/corelib | |
parent | 2575a8ced39b607ed320ed230c83119eaad4b33b (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')
-rw-r--r-- | src/corelib/text/qlocale.cpp | 24 | ||||
-rw-r--r-- | src/corelib/text/qlocale.h | 20 | ||||
-rw-r--r-- | src/corelib/text/qlocale.qdoc | 4 |
3 files changed, 23 insertions, 25 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; diff --git a/src/corelib/text/qlocale.h b/src/corelib/text/qlocale.h index 864e2c0904..ff4ca9d133 100644 --- a/src/corelib/text/qlocale.h +++ b/src/corelib/text/qlocale.h @@ -500,12 +500,16 @@ public: Chewa = Nyanja, Frisian = WesternFrisian, Kurundi = Rundi, - Moldavian = Romanian, - Norwegian = NorwegianBokmal, +#if QT_DEPRECATED_SINCE(5, 15) + Moldavian Q_DECL_ENUMERATOR_DEPRECATED_X("Obsolete name, use Romanian") = Romanian, + Norwegian Q_DECL_ENUMERATOR_DEPRECATED_X("Obsolete name, use NorwegianBokmal") = NorwegianBokmal, +#endif RhaetoRomance = Romansh, - SerboCroatian = Serbian, - Tagalog = Filipino, - Twi = Akan, +#if QT_DEPRECATED_SINCE(5, 15) + SerboCroatian Q_DECL_ENUMERATOR_DEPRECATED_X("Obsolete name, use Serbian") = Serbian, + Tagalog Q_DECL_ENUMERATOR_DEPRECATED_X("Obsolete name, use Filipino") = Filipino, + Twi Q_DECL_ENUMERATOR_DEPRECATED_X("Obsolete name, use Akan") = Akan, +#endif Uigur = Uighur, LastLanguage = NigerianPidgin @@ -932,8 +936,10 @@ public: RepublicOfKorea = SouthKorea, RussianFederation = Russia, SyrianArabRepublic = Syria, - Tokelau = TokelauCountry, - Tuvalu = TuvaluCountry, +#if QT_DEPRECATED_SINCE(5, 15) + Tokelau Q_DECL_ENUMERATOR_DEPRECATED_X("Obsolete name, use TokelauCountry") = TokelauCountry, + Tuvalu Q_DECL_ENUMERATOR_DEPRECATED_X("Obsolete name, use TuvaluCountry") = TuvaluCountry, +#endif LastCountry = Europe }; diff --git a/src/corelib/text/qlocale.qdoc b/src/corelib/text/qlocale.qdoc index f366cdb584..9bf2131150 100644 --- a/src/corelib/text/qlocale.qdoc +++ b/src/corelib/text/qlocale.qdoc @@ -349,9 +349,9 @@ \value NorthernSotho \value NorthernThai Obsolete, no locale data available \value NorthNdebele - \value NorwegianBokmal same as Norwegian + \value NorwegianBokmal \value NorwegianNynorsk - \value Norwegian same as NorwegianBokmal + \value Norwegian Obsolete, please use NorwegianBokmal \value Nuer \value Nyanja \value Nyankole |