remove unused QLocale methods

no reason to keep them

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2024-03-15 01:34:57 +02:00
parent 7ebb19ca2c
commit 267e7b5b73
6 changed files with 0 additions and 774 deletions

View file

@ -351,7 +351,6 @@ def printlocaledata(frommap, key):
%s, %s, %s,
%s, %s, %s,
%s, %s, %s, %s, %s, %s, %s, %s,
%s, %s,
%s, %s, %s, %s,
%s, %s,
%s,
@ -381,8 +380,6 @@ def printlocaledata(frommap, key):
touint(value['plus']),
touint(value['exponential']),
touint(value['zero']),
tochar(value['language_endonym']),
tochar(value['country_endonym']),
tochar(value['short_date_format']),
tochar(value['long_date_format']),
tochar(value['short_time_format']),
@ -601,8 +598,6 @@ localedefaults = {
'plus': '+',
'exponential': 'e', # default in CLDR is E
# strings
'language_endonym': '',
'country_endonym': '',
'short_date_format': 'd MMM yyyy', # default in CLDR is y-MM-dd
'long_date_format': 'd MMMM yyyy',
'short_time_format': 'HH:mm:ss', # default in CLDR is HH:mm
@ -765,19 +760,6 @@ def readlocale(fromxml, tomap, isparent):
# locale numeric system was found, break
break
for nativelang in root.findall('./localeDisplayNames/languages/language'):
nativelangtype = nativelang.get('type')
if nativelangtype == langtype:
tomap[locale]['language_endonym'] = nativelang.text
break
if countrytype:
for nativecountry in root.findall('./localeDisplayNames/territories/territory'):
nativecountrytype = nativecountry.get('type')
if nativecountrytype == countrytype:
tomap[locale]['country_endonym'] = nativecountry.text
break
for calendar in root.findall('./dates/calendars/calendar'):
calendartype = calendar.get('type')
if not calendartype == 'gregorian':

View file

@ -2495,56 +2495,6 @@ qulonglong QLocalePrivate::bytearrayToUnsLongLong(const char *num, int base, boo
return ret;
}
/*!
\since 4.8
Returns an ordered list of locale names for translation purposes in
preference order.
The return value represents locale names that the user expects to see the
UI translation in.
Most like you do not need to use this function directly, but just pass the
QLocale object to the QTranslator::load() function.
The first item in the list is the most preferred one.
\sa QTranslator, bcp47Name()
*/
QStringList QLocale::uiLanguages() const
{
QStringList result;
const QByteArray asciibcp47 = bcp47Name();
result.append(QString::fromLatin1(asciibcp47.constData(), asciibcp47.size()));
return result;
}
/*!
\since 4.8
Returns a native name of the language for the locale. For example
"Schwiizertüütsch" for Swiss-German locale.
\sa nativeCountryName(), languageToString()
*/
QString QLocale::nativeLanguageName() const
{
return getLocaleData(d()->m_language_endonym);
}
/*!
\since 4.8
Returns a native name of the country for the locale. For example
"España" for Spanish/Spain locale.
\sa nativeLanguageName(), countryToString()
*/
QString QLocale::nativeCountryName() const
{
return getLocaleData(d()->m_country_endonym);
}
QT_END_NAMESPACE
#ifndef QT_NO_QOBJECT

View file

@ -1300,8 +1300,6 @@ public:
QString name() const;
QByteArray bcp47Name() const;
QString nativeLanguageName() const;
QString nativeCountryName() const;
short toShort(const QString &s, bool *ok = nullptr, int base = 0) const;
ushort toUShort(const QString &s, bool *ok = nullptr, int base = 0) const;
@ -1367,8 +1365,6 @@ public:
QString toUpper(const QString &str) const;
QString toLower(const QString &str) const;
QStringList uiLanguages() const;
inline bool operator==(const QLocale &other) const;
inline bool operator!=(const QLocale &other) const;

File diff suppressed because it is too large Load diff

View file

@ -150,8 +150,6 @@ public:
const ushort m_plus;
const ushort m_exponential;
const uint m_zero;
const char* m_language_endonym;
const char* m_country_endonym;
const char* m_short_date_format;
const char* m_long_date_format;
const char* m_short_time_format;

View file

@ -100,7 +100,6 @@ private slots:
void defaultNumeringSystem();
void ampm();
void uiLanguages();
void weekendDays();
private:
@ -1566,21 +1565,6 @@ void tst_QLocale::standaloneMonthName()
QCOMPARE(ru.standaloneMonthName(1, QLocale::NarrowFormat), QString::fromUtf8("Я"));
}
void tst_QLocale::uiLanguages()
{
const QLocale c(QLocale::C);
QCOMPARE(c.uiLanguages().size(), 1);
QCOMPARE(c.uiLanguages().at(0), QLatin1String("C"));
const QLocale en_US("en_US");
QCOMPARE(en_US.uiLanguages().size(), 1);
QCOMPARE(en_US.uiLanguages().at(0), QLatin1String("en-Dsrt-US"));
const QLocale ru_RU("ru_RU");
QCOMPARE(ru_RU.uiLanguages().size(), 1);
QCOMPARE(ru_RU.uiLanguages().at(0), QLatin1String("ru-Cyrl-RU"));
}
void tst_QLocale::weekendDays()
{
const QLocale c(QLocale::C);