Fix compatibility with < Qt 5.15.

This commit is contained in:
Roman Telezhynskyi 2023-06-29 19:08:39 +03:00
parent e6533cb697
commit b443159cf5

View File

@ -332,7 +332,11 @@ auto VGAnalytics::GetTerritoryCode(QLocale::Country territory) -> QString
{QLocale::Bermuda, QLatin1String("BM")}, {QLocale::Bermuda, QLatin1String("BM")},
{QLocale::Bhutan, QLatin1String("BT")}, {QLocale::Bhutan, QLatin1String("BT")},
{QLocale::Bolivia, QLatin1String("BO")}, {QLocale::Bolivia, QLatin1String("BO")},
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
{QLocale::BosniaAndHerzegovina, QLatin1String("BA")}, {QLocale::BosniaAndHerzegovina, QLatin1String("BA")},
#else
{QLocale::BosniaAndHerzegowina, QLatin1String("BA")},
#endif
{QLocale::Botswana, QLatin1String("BW")}, {QLocale::Botswana, QLatin1String("BW")},
{QLocale::BouvetIsland, QLatin1String("BV")}, {QLocale::BouvetIsland, QLatin1String("BV")},
{QLocale::Brazil, QLatin1String("BR")}, {QLocale::Brazil, QLatin1String("BR")},
@ -347,7 +351,9 @@ auto VGAnalytics::GetTerritoryCode(QLocale::Country territory) -> QString
{QLocale::Canada, QLatin1String("CA")}, {QLocale::Canada, QLatin1String("CA")},
{QLocale::CanaryIslands, QLatin1String("IC")}, {QLocale::CanaryIslands, QLatin1String("IC")},
{QLocale::CapeVerde, QLatin1String("CV")}, {QLocale::CapeVerde, QLatin1String("CV")},
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
{QLocale::CaribbeanNetherlands, QLatin1String("BQ")}, {QLocale::CaribbeanNetherlands, QLatin1String("BQ")},
#endif
{QLocale::CaymanIslands, QLatin1String("KY")}, {QLocale::CaymanIslands, QLatin1String("KY")},
{QLocale::CentralAfricanRepublic, QLatin1String("CF")}, {QLocale::CentralAfricanRepublic, QLatin1String("CF")},
{QLocale::CeutaAndMelilla, QLatin1String("EA")}, {QLocale::CeutaAndMelilla, QLatin1String("EA")},
@ -365,9 +371,17 @@ auto VGAnalytics::GetTerritoryCode(QLocale::Country territory) -> QString
{QLocale::CostaRica, QLatin1String("CR")}, {QLocale::CostaRica, QLatin1String("CR")},
{QLocale::Croatia, QLatin1String("HR")}, {QLocale::Croatia, QLatin1String("HR")},
{QLocale::Cuba, QLatin1String("CU")}, {QLocale::Cuba, QLatin1String("CU")},
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
{QLocale::Curacao, QLatin1String("CW")}, {QLocale::Curacao, QLatin1String("CW")},
#else
{QLocale::CuraSao, QLatin1String("CW")},
#endif
{QLocale::Cyprus, QLatin1String("CY")}, {QLocale::Cyprus, QLatin1String("CY")},
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
{QLocale::Czechia, QLatin1String("CZ")}, {QLocale::Czechia, QLatin1String("CZ")},
#else
{QLocale::Czech, QLatin1String("CZ")},
#endif
{QLocale::Denmark, QLatin1String("DK")}, {QLocale::Denmark, QLatin1String("DK")},
{QLocale::DiegoGarcia, QLatin1String("DG")}, {QLocale::DiegoGarcia, QLatin1String("DG")},
{QLocale::Djibouti, QLatin1String("DJ")}, {QLocale::Djibouti, QLatin1String("DJ")},
@ -379,7 +393,11 @@ auto VGAnalytics::GetTerritoryCode(QLocale::Country territory) -> QString
{QLocale::EquatorialGuinea, QLatin1String("GQ")}, {QLocale::EquatorialGuinea, QLatin1String("GQ")},
{QLocale::Eritrea, QLatin1String("ER")}, {QLocale::Eritrea, QLatin1String("ER")},
{QLocale::Estonia, QLatin1String("EE")}, {QLocale::Estonia, QLatin1String("EE")},
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
{QLocale::Eswatini, QLatin1String("SZ")}, {QLocale::Eswatini, QLatin1String("SZ")},
#else
{QLocale::Swaziland, QLatin1String("SZ")},
#endif
{QLocale::Ethiopia, QLatin1String("ET")}, {QLocale::Ethiopia, QLatin1String("ET")},
{QLocale::Europe, QLatin1String("150")}, {QLocale::Europe, QLatin1String("150")},
{QLocale::EuropeanUnion, QLatin1String("EU")}, {QLocale::EuropeanUnion, QLatin1String("EU")},
@ -442,7 +460,11 @@ auto VGAnalytics::GetTerritoryCode(QLocale::Country territory) -> QString
{QLocale::Liechtenstein, QLatin1String("LI")}, {QLocale::Liechtenstein, QLatin1String("LI")},
{QLocale::Lithuania, QLatin1String("LT")}, {QLocale::Lithuania, QLatin1String("LT")},
{QLocale::Luxembourg, QLatin1String("LU")}, {QLocale::Luxembourg, QLatin1String("LU")},
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
{QLocale::Macao, QLatin1String("MO")}, {QLocale::Macao, QLatin1String("MO")},
#else
{QLocale::Macau, QLatin1String("MO")},
#endif
{QLocale::Macedonia, QLatin1String("MK")}, {QLocale::Macedonia, QLatin1String("MK")},
{QLocale::Madagascar, QLatin1String("MG")}, {QLocale::Madagascar, QLatin1String("MG")},
{QLocale::Malawi, QLatin1String("MW")}, {QLocale::Malawi, QLatin1String("MW")},
@ -504,7 +526,11 @@ auto VGAnalytics::GetTerritoryCode(QLocale::Country territory) -> QString
{QLocale::SaintLucia, QLatin1String("LC")}, {QLocale::SaintLucia, QLatin1String("LC")},
{QLocale::SaintMartin, QLatin1String("MF")}, {QLocale::SaintMartin, QLatin1String("MF")},
{QLocale::SaintPierreAndMiquelon, QLatin1String("PM")}, {QLocale::SaintPierreAndMiquelon, QLatin1String("PM")},
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
{QLocale::SaintVincentAndGrenadines, QLatin1String("VC")}, {QLocale::SaintVincentAndGrenadines, QLatin1String("VC")},
#else
{QLocale::SaintVincentAndTheGrenadines, QLatin1String("VC")},
#endif
{QLocale::Samoa, QLatin1String("WS")}, {QLocale::Samoa, QLatin1String("WS")},
{QLocale::SanMarino, QLatin1String("SM")}, {QLocale::SanMarino, QLatin1String("SM")},
{QLocale::SaoTomeAndPrincipe, QLatin1String("ST")}, {QLocale::SaoTomeAndPrincipe, QLatin1String("ST")},
@ -520,14 +546,23 @@ auto VGAnalytics::GetTerritoryCode(QLocale::Country territory) -> QString
{QLocale::SolomonIslands, QLatin1String("SB")}, {QLocale::SolomonIslands, QLatin1String("SB")},
{QLocale::Somalia, QLatin1String("SO")}, {QLocale::Somalia, QLatin1String("SO")},
{QLocale::SouthAfrica, QLatin1String("ZA")}, {QLocale::SouthAfrica, QLatin1String("ZA")},
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
{QLocale::SouthGeorgiaAndSouthSandwichIslands, QLatin1String("GS")}, {QLocale::SouthGeorgiaAndSouthSandwichIslands, QLatin1String("GS")},
#else
{QLocale::SouthGeorgiaAndTheSouthSandwichIslands, QLatin1String("GS")},
#endif
{QLocale::SouthKorea, QLatin1String("KR")}, {QLocale::SouthKorea, QLatin1String("KR")},
{QLocale::SouthSudan, QLatin1String("SS")}, {QLocale::SouthSudan, QLatin1String("SS")},
{QLocale::Spain, QLatin1String("ES")}, {QLocale::Spain, QLatin1String("ES")},
{QLocale::SriLanka, QLatin1String("LK")}, {QLocale::SriLanka, QLatin1String("LK")},
{QLocale::Sudan, QLatin1String("SD")}, {QLocale::Sudan, QLatin1String("SD")},
{QLocale::Suriname, QLatin1String("SR")}, {QLocale::Suriname, QLatin1String("SR")},
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
{QLocale::SvalbardAndJanMayen, QLatin1String("SJ")}, {QLocale::SvalbardAndJanMayen, QLatin1String("SJ")},
#else
{QLocale::SvalbardAndJanMayenIslands, QLatin1String("SJ")},
#endif
{QLocale::Sweden, QLatin1String("SE")}, {QLocale::Sweden, QLatin1String("SE")},
{QLocale::Switzerland, QLatin1String("CH")}, {QLocale::Switzerland, QLatin1String("CH")},
{QLocale::Syria, QLatin1String("SY")}, {QLocale::Syria, QLatin1String("SY")},
@ -535,7 +570,11 @@ auto VGAnalytics::GetTerritoryCode(QLocale::Country territory) -> QString
{QLocale::Tajikistan, QLatin1String("TJ")}, {QLocale::Tajikistan, QLatin1String("TJ")},
{QLocale::Tanzania, QLatin1String("TZ")}, {QLocale::Tanzania, QLatin1String("TZ")},
{QLocale::Thailand, QLatin1String("TH")}, {QLocale::Thailand, QLatin1String("TH")},
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
{QLocale::TimorLeste, QLatin1String("TL")}, {QLocale::TimorLeste, QLatin1String("TL")},
#else
{QLocale::EastTimor, QLatin1String("TL")},
#endif
{QLocale::Togo, QLatin1String("TG")}, {QLocale::Togo, QLatin1String("TG")},
{QLocale::TokelauCountry, QLatin1String("TK")}, {QLocale::TokelauCountry, QLatin1String("TK")},
{QLocale::Tonga, QLatin1String("TO")}, {QLocale::Tonga, QLatin1String("TO")},
@ -550,16 +589,28 @@ auto VGAnalytics::GetTerritoryCode(QLocale::Country territory) -> QString
{QLocale::Ukraine, QLatin1String("UA")}, {QLocale::Ukraine, QLatin1String("UA")},
{QLocale::UnitedArabEmirates, QLatin1String("AE")}, {QLocale::UnitedArabEmirates, QLatin1String("AE")},
{QLocale::UnitedKingdom, QLatin1String("GB")}, {QLocale::UnitedKingdom, QLatin1String("GB")},
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
{QLocale::UnitedStatesOutlyingIslands, QLatin1String("UM")}, {QLocale::UnitedStatesOutlyingIslands, QLatin1String("UM")},
#else
{QLocale::UnitedStatesMinorOutlyingIslands, QLatin1String("UM")},
#endif
{QLocale::UnitedStates, QLatin1String("US")}, {QLocale::UnitedStates, QLatin1String("US")},
{QLocale::UnitedStatesVirginIslands, QLatin1String("VI")}, {QLocale::UnitedStatesVirginIslands, QLatin1String("VI")},
{QLocale::Uruguay, QLatin1String("UY")}, {QLocale::Uruguay, QLatin1String("UY")},
{QLocale::Uzbekistan, QLatin1String("UZ")}, {QLocale::Uzbekistan, QLatin1String("UZ")},
{QLocale::Vanuatu, QLatin1String("VU")}, {QLocale::Vanuatu, QLatin1String("VU")},
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
{QLocale::VaticanCity, QLatin1String("VA")}, {QLocale::VaticanCity, QLatin1String("VA")},
#else
{QLocale::VaticanCityState, QLatin1String("VA")},
#endif
{QLocale::Venezuela, QLatin1String("VE")}, {QLocale::Venezuela, QLatin1String("VE")},
{QLocale::Vietnam, QLatin1String("VN")}, {QLocale::Vietnam, QLatin1String("VN")},
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
{QLocale::WallisAndFutuna, QLatin1String("WF")}, {QLocale::WallisAndFutuna, QLatin1String("WF")},
#else
{QLocale::WallisAndFutunaIslands, QLatin1String("WF")},
#endif
{QLocale::WesternSahara, QLatin1String("EH")}, {QLocale::WesternSahara, QLatin1String("EH")},
{QLocale::World, QLatin1String("001")}, {QLocale::World, QLatin1String("001")},
{QLocale::Yemen, QLatin1String("YE")}, {QLocale::Yemen, QLatin1String("YE")},
@ -572,7 +623,7 @@ auto VGAnalytics::GetTerritoryCode(QLocale::Country territory) -> QString
return territoryCodeList.value(territory); return territoryCodeList.value(territory);
} }
return QString(); return {};
} }
#endif #endif