mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-26 22:33:08 +00:00
Fix deprecated declarations from QLocale
This commit is contained in:
parent
4371c95194
commit
edb8c91d66
1 changed files with 4 additions and 4 deletions
|
|
@ -25,16 +25,16 @@ bool localeAwareCompare(const QString &one, const QString &two)
|
||||||
MobileProviders::MobileProviders()
|
MobileProviders::MobileProviders()
|
||||||
{
|
{
|
||||||
for (int c = 1; c <= QLocale::LastCountry; c++) {
|
for (int c = 1; c <= QLocale::LastCountry; c++) {
|
||||||
const auto country = static_cast<QLocale::Country>(c);
|
const auto country = static_cast<QLocale::Territory>(c);
|
||||||
QLocale locale(QLocale::AnyLanguage, country);
|
QLocale locale(QLocale::AnyLanguage, country);
|
||||||
if (locale.country() == country) {
|
if (locale.territory() == country) {
|
||||||
const QString localeName = locale.name();
|
const QString localeName = locale.name();
|
||||||
const auto idx = localeName.indexOf(QLatin1Char('_'));
|
const auto idx = localeName.indexOf(QLatin1Char('_'));
|
||||||
if (idx != -1) {
|
if (idx != -1) {
|
||||||
const QString countryCode = localeName.mid(idx + 1);
|
const QString countryCode = localeName.mid(idx + 1);
|
||||||
QString countryName = locale.nativeCountryName();
|
QString countryName = locale.nativeTerritoryName();
|
||||||
if (countryName.isEmpty()) {
|
if (countryName.isEmpty()) {
|
||||||
countryName = QLocale::countryToString(country);
|
countryName = QLocale::territoryToString(country);
|
||||||
}
|
}
|
||||||
mCountries.insert(countryCode, countryName);
|
mCountries.insert(countryCode, countryName);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue