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-29 07:29:42 +0100 |
commit | 1459cc8bf664e3a1afeedb972d9f0cb7a3b6b807 (patch) | |
tree | c9d8b0f8eb4a49d64f31d486364e0e880c871e53 /src | |
parent | 4b601331c7a7858e392b9961783dbc7b038fe829 (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
Change-Id: Iebaa0a5a77bfa12f7014de53fab4a25b5f1cc92c
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
(cherry picked from commit 2c4874be40aa40b698315cac0ad768e5c650a740)
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'src')
-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 4617168781..bfd7b15e6b 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 - Q_STATIC_ASSERT(QLocale::Norwegian == QLocale::NorwegianBokmal); - return QLocale::Norwegian; - } - if (uc1 == 't' && uc2 == 'l') { // tl -> fil - Q_STATIC_ASSERT(QLocale::Tagalog == QLocale::Filipino); - return QLocale::Tagalog; - } - if (uc1 == 's' && uc2 == 'h') { // sh -> sr[_Latn] - Q_STATIC_ASSERT(QLocale::SerboCroatian == QLocale::Serbian); - return QLocale::SerboCroatian; - } - if (uc1 == 'm' && uc2 == 'o') { // mo -> ro - Q_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 64dd32cabc..036f064419 100644 --- a/src/corelib/text/qlocale.h +++ b/src/corelib/text/qlocale.h @@ -501,12 +501,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 @@ -933,8 +937,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 56f65766dd..f4b9f5b67d 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 |