summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qlocale.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/tools/qlocale.cpp')
-rw-r--r--src/corelib/tools/qlocale.cpp475
1 files changed, 242 insertions, 233 deletions
diff --git a/src/corelib/tools/qlocale.cpp b/src/corelib/tools/qlocale.cpp
index b9f199e50e..88667f7fbd 100644
--- a/src/corelib/tools/qlocale.cpp
+++ b/src/corelib/tools/qlocale.cpp
@@ -78,8 +78,8 @@ public:
};
Q_GLOBAL_STATIC(QSystemLocaleSingleton, QSystemLocale_globalSystemLocale)
-static QLocalePrivate *system_lp = 0;
-Q_GLOBAL_STATIC(QLocalePrivate, globalLocalePrivate)
+static QLocaleData *system_data = 0;
+Q_GLOBAL_STATIC(QLocaleData, globalLocaleData)
#endif
#ifdef QT_USE_ICU
@@ -157,12 +157,12 @@ QLocale::Country QLocalePrivate::codeToCountry(const QString &code)
QString QLocalePrivate::languageCode() const
{
- if (m_language_id == QLocale::AnyLanguage)
+ if (m_data->m_language_id == QLocale::AnyLanguage)
return QString();
- if (m_language_id == QLocale::C)
+ if (m_data->m_language_id == QLocale::C)
return QLatin1String("C");
- const unsigned char *c = language_code_list + 3*(uint(m_language_id));
+ const unsigned char *c = language_code_list + 3*(uint(m_data->m_language_id));
QString code(c[2] == 0 ? 2 : 3, Qt::Uninitialized);
@@ -176,18 +176,18 @@ QString QLocalePrivate::languageCode() const
QString QLocalePrivate::scriptCode() const
{
- if (m_script_id == QLocale::AnyScript || m_script_id > QLocale::LastScript)
+ if (m_data->m_script_id == QLocale::AnyScript || m_data->m_script_id > QLocale::LastScript)
return QString();
- const unsigned char *c = script_code_list + 4*(uint(m_script_id));
+ const unsigned char *c = script_code_list + 4*(uint(m_data->m_script_id));
return QString::fromLatin1((const char *)c, 4);
}
QString QLocalePrivate::countryCode() const
{
- if (m_country_id == QLocale::AnyCountry)
+ if (m_data->m_country_id == QLocale::AnyCountry)
return QString();
- const unsigned char *c = country_code_list + 3*(uint(m_country_id));
+ const unsigned char *c = country_code_list + 3*(uint(m_data->m_country_id));
QString code(c[2] == 0 ? 2 : 3, Qt::Uninitialized);
@@ -201,15 +201,15 @@ QString QLocalePrivate::countryCode() const
QString QLocalePrivate::bcp47Name() const
{
- if (m_language_id == QLocale::AnyLanguage)
+ if (m_data->m_language_id == QLocale::AnyLanguage)
return QString();
- if (m_language_id == QLocale::C)
+ if (m_data->m_language_id == QLocale::C)
return QLatin1String("C");
- const unsigned char *lang = language_code_list + 3*(uint(m_language_id));
+ const unsigned char *lang = language_code_list + 3*(uint(m_data->m_language_id));
const unsigned char *script =
- (m_script_id != QLocale::AnyScript ? script_code_list + 4*(uint(m_script_id)) : 0);
+ (m_data->m_script_id != QLocale::AnyScript ? script_code_list + 4*(uint(m_data->m_script_id)) : 0);
const unsigned char *country =
- (m_country_id != QLocale::AnyCountry ? country_code_list + 3*(uint(m_country_id)) : 0);
+ (m_data->m_country_id != QLocale::AnyCountry ? country_code_list + 3*(uint(m_data->m_country_id)) : 0);
char len = (lang[2] != 0 ? 3 : 2) + (script ? 4+1 : 0) + (country ? (country[2] != 0 ? 3 : 2)+1 : 0);
QString name(len, Qt::Uninitialized);
QChar *uc = name.data();
@@ -234,7 +234,7 @@ QString QLocalePrivate::bcp47Name() const
return name;
}
-const QLocalePrivate *QLocalePrivate::findLocale(QLocale::Language language, QLocale::Script script, QLocale::Country country)
+const QLocaleData *QLocaleData::findLocaleData(QLocale::Language language, QLocale::Script script, QLocale::Country country)
{
const unsigned language_id = language;
const unsigned script_id = script;
@@ -242,33 +242,33 @@ const QLocalePrivate *QLocalePrivate::findLocale(QLocale::Language language, QLo
uint idx = locale_index[language_id];
- const QLocalePrivate *d = locale_data + idx;
+ const QLocaleData *data = locale_data + idx;
if (idx == 0) // default language has no associated country
- return d;
+ return data;
if (script == QLocale::AnyScript && country == QLocale::AnyCountry)
- return d;
+ return data;
- Q_ASSERT(d->languageId() == language_id);
+ Q_ASSERT(data->m_language_id == language_id);
if (country == QLocale::AnyCountry) {
- while (d->m_language_id == language_id && d->m_script_id != script_id)
- ++d;
- if (d->m_language_id == language_id && d->m_script_id == script_id)
- return d;
+ while (data->m_language_id == language_id && data->m_script_id != script_id)
+ ++data;
+ if (data->m_language_id == language_id && data->m_script_id == script_id)
+ return data;
} else if (script == QLocale::AnyScript) {
- while (d->m_language_id == language_id) {
- if (d->m_script_id == script_id && d->m_country_id == country_id)
- return d;
- ++d;
+ while (data->m_language_id == language_id) {
+ if (data->m_script_id == script_id && data->m_country_id == country_id)
+ return data;
+ ++data;
}
} else {
// both script and country are explicitly specified
- while (d->m_language_id == language_id) {
- if (d->m_script_id == script_id && d->m_country_id == country_id)
- return d;
- ++d;
+ while (data->m_language_id == language_id) {
+ if (data->m_script_id == script_id && data->m_country_id == country_id)
+ return data;
+ ++data;
}
}
@@ -370,14 +370,14 @@ void QLocalePrivate::getLangAndCountry(const QString &name, QLocale::Language &l
cntry = QLocalePrivate::codeToCountry(cntry_code);
}
-static const QLocalePrivate *findLocale(const QString &name)
+static const QLocaleData *findLocaleData(const QString &name)
{
QLocale::Language lang;
QLocale::Script script;
QLocale::Country cntry;
QLocalePrivate::getLangAndCountry(name, lang, script, cntry);
- return QLocalePrivate::findLocale(lang, script, cntry);
+ return QLocaleData::findLocaleData(lang, script, cntry);
}
QString qt_readEscapedFormatString(const QString &format, int *idx)
@@ -423,7 +423,7 @@ int qt_repeatCount(const QString &s, int i)
return j - i;
}
-static const QLocalePrivate *default_lp = 0;
+static const QLocaleData *default_data = 0;
static uint default_number_options = 0;
#ifndef QT_NO_SYSTEMLOCALE
@@ -443,8 +443,8 @@ QSystemLocale::QSystemLocale()
delete _systemLocale;
_systemLocale = this;
- if (system_lp)
- system_lp->m_language_id = 0;
+ if (system_data)
+ system_data->m_language_id = 0;
}
/*! \internal */
@@ -459,8 +459,8 @@ QSystemLocale::~QSystemLocale()
if (_systemLocale == this) {
_systemLocale = 0;
- if (system_lp)
- system_lp->m_language_id = 0;
+ if (system_data)
+ system_data->m_language_id = 0;
}
}
@@ -474,74 +474,74 @@ static const QSystemLocale *systemLocale()
void QLocalePrivate::updateSystemPrivate()
{
const QSystemLocale *sys_locale = systemLocale();
- if (!system_lp)
- system_lp = globalLocalePrivate();
+ if (!system_data)
+ system_data = globalLocaleData();
// tell the object that the system locale has changed.
sys_locale->query(QSystemLocale::LocaleChanged, QVariant());
- *system_lp = *sys_locale->fallbackLocale().d();
+ *system_data = *sys_locale->fallbackLocale().d->m_data;
QVariant res = sys_locale->query(QSystemLocale::LanguageId, QVariant());
if (!res.isNull()) {
- system_lp->m_language_id = res.toInt();
- system_lp->m_script_id = QLocale::AnyScript; // default for compatibility
+ system_data->m_language_id = res.toInt();
+ system_data->m_script_id = QLocale::AnyScript; // default for compatibility
}
res = sys_locale->query(QSystemLocale::CountryId, QVariant());
if (!res.isNull()) {
- system_lp->m_country_id = res.toInt();
- system_lp->m_script_id = QLocale::AnyScript; // default for compatibility
+ system_data->m_country_id = res.toInt();
+ system_data->m_script_id = QLocale::AnyScript; // default for compatibility
}
res = sys_locale->query(QSystemLocale::ScriptId, QVariant());
if (!res.isNull())
- system_lp->m_script_id = res.toInt();
+ system_data->m_script_id = res.toInt();
res = sys_locale->query(QSystemLocale::DecimalPoint, QVariant());
if (!res.isNull())
- system_lp->m_decimal = res.toString().at(0).unicode();
+ system_data->m_decimal = res.toString().at(0).unicode();
res = sys_locale->query(QSystemLocale::GroupSeparator, QVariant());
if (!res.isNull())
- system_lp->m_group = res.toString().at(0).unicode();
+ system_data->m_group = res.toString().at(0).unicode();
res = sys_locale->query(QSystemLocale::ZeroDigit, QVariant());
if (!res.isNull())
- system_lp->m_zero = res.toString().at(0).unicode();
+ system_data->m_zero = res.toString().at(0).unicode();
res = sys_locale->query(QSystemLocale::NegativeSign, QVariant());
if (!res.isNull())
- system_lp->m_minus = res.toString().at(0).unicode();
+ system_data->m_minus = res.toString().at(0).unicode();
res = sys_locale->query(QSystemLocale::PositiveSign, QVariant());
if (!res.isNull())
- system_lp->m_plus = res.toString().at(0).unicode();
+ system_data->m_plus = res.toString().at(0).unicode();
#ifdef QT_USE_ICU
- if (!default_lp)
- qt_initIcu(system_lp->bcp47Name());
+ if (!default_data)
+ qt_initIcu(sys_locale->fallbackLocale().bcp47Name());
#endif
}
#endif
-static const QLocalePrivate *systemPrivate()
+static const QLocaleData *systemData()
{
#ifndef QT_NO_SYSTEMLOCALE
// copy over the information from the fallback locale and modify
- if (!system_lp || system_lp->m_language_id == 0)
+ if (!system_data || system_data->m_language_id == 0)
QLocalePrivate::updateSystemPrivate();
- return system_lp;
+ return system_data;
#else
return locale_data;
#endif
}
-static const QLocalePrivate *defaultPrivate()
+static const QLocaleData *defaultData()
{
- if (!default_lp)
- default_lp = systemPrivate();
- return default_lp;
+ if (!default_data)
+ default_data = systemData();
+ return default_data;
}
static QString getLocaleListData(const ushort *data, int size, int index)
@@ -585,14 +585,14 @@ QDataStream &operator>>(QDataStream &ds, QLocale &l)
#endif // QT_NO_DATASTREAM
-static const int locale_data_size = sizeof(locale_data)/sizeof(QLocalePrivate) - 1;
+static const int locale_data_size = sizeof(locale_data)/sizeof(QLocaleData) - 1;
-static const QLocalePrivate *dataPointerHelper(quint16 index)
+static const QLocaleData *dataPointerHelper(quint16 index)
{
#ifndef QT_NO_SYSTEMLOCALE
Q_ASSERT(index <= locale_data_size);
if (index == locale_data_size)
- return system_lp;
+ return system_data;
#else
Q_ASSERT(index < locale_data_size);
#endif
@@ -600,12 +600,12 @@ static const QLocalePrivate *dataPointerHelper(quint16 index)
return &locale_data[index];
}
-static quint16 localePrivateIndex(const QLocalePrivate *p)
+static quint16 localeDataIndex(const QLocaleData *p)
{
#ifndef QT_NO_SYSTEMLOCALE
Q_ASSERT((p >= locale_data && p - locale_data < locale_data_size)
- || (p != 0 && p == system_lp));
- quint16 index = p == system_lp ? locale_data_size : p - locale_data;
+ || (p != 0 && p == system_data));
+ quint16 index = p == system_data ? locale_data_size : p - locale_data;
#else
Q_ASSERT(p >= locale_data && p - locale_data < locale_data_size);
quint16 index = p - locale_data;
@@ -644,10 +644,11 @@ static quint16 localePrivateIndex(const QLocalePrivate *p)
*/
QLocale::QLocale(const QString &name)
- : v(0)
+ : d(new QLocalePrivate())
{
- p.numberOptions = 0;
- p.index = localePrivateIndex(findLocale(name));
+ d->m_numberOptions = 0;
+ d->m_index = localeDataIndex(findLocaleData(name));
+ d->m_data = dataPointerHelper(d->m_index);
}
/*!
@@ -659,10 +660,11 @@ QLocale::QLocale(const QString &name)
*/
QLocale::QLocale()
- : v(0)
+ : d(new QLocalePrivate())
{
- p.numberOptions = default_number_options;
- p.index = localePrivateIndex(defaultPrivate());
+ d->m_numberOptions = default_number_options;
+ d->m_index = localeDataIndex(defaultData());
+ d->m_data = dataPointerHelper(d->m_index);
}
/*!
@@ -681,22 +683,23 @@ QLocale::QLocale()
The language and country that are actually used can be queried
using language() and country().
- \sa setDefault() language() country()
+ \sa setDefault(), language(), country()
*/
QLocale::QLocale(Language language, Country country)
- : v(0)
+ : d(new QLocalePrivate())
{
- const QLocalePrivate *d = QLocalePrivate::findLocale(language, QLocale::AnyScript, country);
+ const QLocaleData *data = QLocaleData::findLocaleData(language, QLocale::AnyScript, country);
// If not found, should default to system
- if (d->languageId() == QLocale::C && language != QLocale::C) {
- p.numberOptions = default_number_options;
- p.index = localePrivateIndex(defaultPrivate());
+ if (data->m_language_id == QLocale::C && language != QLocale::C) {
+ d->m_numberOptions = default_number_options;
+ d->m_index = localeDataIndex(defaultData());
} else {
- p.numberOptions = 0;
- p.index = localePrivateIndex(d);
+ d->m_numberOptions = 0;
+ d->m_index = localeDataIndex(data);
}
+ d->m_data = dataPointerHelper(d->m_index);
}
\
/*!
@@ -720,22 +723,23 @@ QLocale::QLocale(Language language, Country country)
The language, script and country that are actually used can be queried
using language(), script() and country().
- \sa setDefault() language() script() country()
+ \sa setDefault(), language(), script(), country()
*/
QLocale::QLocale(Language language, Script script, Country country)
- : v(0)
+ : d(new QLocalePrivate())
{
- const QLocalePrivate *d = QLocalePrivate::findLocale(language, script, country);
+ const QLocaleData *data = QLocaleData::findLocaleData(language, script, country);
// If not found, should default to system
- if (d->languageId() == QLocale::C && language != QLocale::C) {
- p.numberOptions = default_number_options;
- p.index = localePrivateIndex(defaultPrivate());
+ if (data->m_language_id == QLocale::C && language != QLocale::C) {
+ d->m_numberOptions = default_number_options;
+ d->m_index = localeDataIndex(defaultData());
} else {
- p.numberOptions = 0;
- p.index = localePrivateIndex(d);
+ d->m_numberOptions = 0;
+ d->m_index = localeDataIndex(data);
}
+ d->m_data = dataPointerHelper(d->m_index);
}
/*!
@@ -744,12 +748,15 @@ QLocale::QLocale(Language language, Script script, Country country)
QLocale::QLocale(const QLocale &other)
{
- v = other.v;
+ d = other.d;
}
-const QLocalePrivate *QLocale::d() const
+/*!
+ Destructor
+*/
+
+QLocale::~QLocale()
{
- return dataPointerHelper(p.index);
}
/*!
@@ -759,18 +766,18 @@ const QLocalePrivate *QLocale::d() const
QLocale &QLocale::operator=(const QLocale &other)
{
- v = other.v;
+ d = other.d;
return *this;
}
bool QLocale::operator==(const QLocale &other) const
{
- return d() == other.d() && numberOptions() == other.numberOptions();
+ return d->m_data == other.d->m_data && d->m_numberOptions == other.d->m_numberOptions;
}
bool QLocale::operator!=(const QLocale &other) const
{
- return d() != other.d() || numberOptions() != other.numberOptions();
+ return d->m_data != other.d->m_data || d->m_numberOptions != other.d->m_numberOptions;
}
/*!
@@ -781,7 +788,7 @@ bool QLocale::operator!=(const QLocale &other) const
*/
void QLocale::setNumberOptions(NumberOptions options)
{
- p.numberOptions = options;
+ d->m_numberOptions = options;
}
/*!
@@ -794,7 +801,7 @@ void QLocale::setNumberOptions(NumberOptions options)
*/
QLocale::NumberOptions QLocale::numberOptions() const
{
- return static_cast<NumberOption>(p.numberOptions);
+ return static_cast<NumberOption>(d->m_numberOptions);
}
/*!
@@ -816,7 +823,7 @@ QString QLocale::quoteString(const QString &str, QuotationStyle style) const
QString QLocale::quoteString(const QStringRef &str, QuotationStyle style) const
{
#ifndef QT_NO_SYSTEMLOCALE
- if (d() == systemPrivate()) {
+ if (d->m_data == systemData()) {
QVariant res;
if (style == QLocale::AlternateQuotation)
res = systemLocale()->query(QSystemLocale::StringToAlternateQuotation, QVariant::fromValue(str));
@@ -828,9 +835,9 @@ QString QLocale::quoteString(const QStringRef &str, QuotationStyle style) const
#endif
if (style == QLocale::StandardQuotation)
- return QChar(d()->m_quotation_start) % str % QChar(d()->m_quotation_end);
+ return QChar(d->m_data->m_quotation_start) % str % QChar(d->m_data->m_quotation_end);
else
- return QChar(d()->m_alternate_quotation_start) % str % QChar(d()->m_alternate_quotation_end);
+ return QChar(d->m_data->m_alternate_quotation_start) % str % QChar(d->m_data->m_alternate_quotation_end);
}
/*!
@@ -842,7 +849,7 @@ QString QLocale::quoteString(const QStringRef &str, QuotationStyle style) const
QString QLocale::createSeparatedList(const QStringList &list) const
{
#ifndef QT_NO_SYSTEMLOCALE
- if (d() == systemPrivate()) {
+ if (d->m_data == systemData()) {
QVariant res;
res = systemLocale()->query(QSystemLocale::ListToSeparatedString, QVariant::fromValue(list));
@@ -855,12 +862,12 @@ QString QLocale::createSeparatedList(const QStringList &list) const
if (size == 1) {
return list.at(0);
} else if (size == 2) {
- QString format = getLocaleData(list_pattern_part_data + d()->m_list_pattern_part_two_idx, d()->m_list_pattern_part_two_size);
+ QString format = getLocaleData(list_pattern_part_data + d->m_data->m_list_pattern_part_two_idx, d->m_data->m_list_pattern_part_two_size);
return format.arg(list.at(0), list.at(1));
} else if (size > 2) {
- QString formatStart = getLocaleData(list_pattern_part_data + d()->m_list_pattern_part_start_idx, d()->m_list_pattern_part_start_size);
- QString formatMid = getLocaleData(list_pattern_part_data + d()->m_list_pattern_part_mid_idx, d()->m_list_pattern_part_mid_size);
- QString formatEnd = getLocaleData(list_pattern_part_data + d()->m_list_pattern_part_end_idx, d()->m_list_pattern_part_end_size);
+ QString formatStart = getLocaleData(list_pattern_part_data + d->m_data->m_list_pattern_part_start_idx, d->m_data->m_list_pattern_part_start_size);
+ QString formatMid = getLocaleData(list_pattern_part_data + d->m_data->m_list_pattern_part_mid_idx, d->m_data->m_list_pattern_part_mid_size);
+ QString formatEnd = getLocaleData(list_pattern_part_data + d->m_data->m_list_pattern_part_end_idx, d->m_data->m_list_pattern_part_end_size);
QString result = formatStart.arg(list.at(0), list.at(1));
for (int i = 2; i < size - 1; ++i)
result = formatMid.arg(result, list.at(i));
@@ -883,12 +890,12 @@ QString QLocale::createSeparatedList(const QStringList &list) const
should be set at application startup, before any non-GUI threads
are created.
- \sa system() c()
+ \sa system(), c()
*/
void QLocale::setDefault(const QLocale &locale)
{
- default_lp = locale.d();
+ default_data = locale.d->m_data;
default_number_options = locale.numberOptions();
#ifdef QT_USE_ICU
@@ -903,7 +910,7 @@ void QLocale::setDefault(const QLocale &locale)
*/
QLocale::Language QLocale::language() const
{
- return Language(d()->languageId());
+ return Language(d->languageId());
}
/*!
@@ -915,7 +922,7 @@ QLocale::Language QLocale::language() const
*/
QLocale::Script QLocale::script() const
{
- return Script(d()->m_script_id);
+ return Script(d->m_data->m_script_id);
}
/*!
@@ -925,7 +932,7 @@ QLocale::Script QLocale::script() const
*/
QLocale::Country QLocale::country() const
{
- return Country(d()->countryId());
+ return Country(d->countryId());
}
/*!
@@ -945,7 +952,7 @@ QString QLocale::name() const
{
Language l = language();
- QString result = d()->languageCode();
+ QString result = d->languageCode();
if (l == C)
return result;
@@ -955,7 +962,7 @@ QString QLocale::name() const
return result;
result.append(QLatin1Char('_'));
- result.append(d()->countryCode());
+ result.append(d->countryCode());
return result;
}
@@ -976,7 +983,7 @@ QString QLocale::name() const
*/
QString QLocale::bcp47Name() const
{
- return d()->bcp47Name();
+ return d->bcp47Name();
}
/*!
@@ -1132,11 +1139,11 @@ uint QLocale::toUInt(const QString &s, bool *ok) const
qlonglong QLocale::toLongLong(const QString &s, bool *ok) const
{
QLocalePrivate::GroupSeparatorMode mode
- = p.numberOptions & RejectGroupSeparator
+ = d->m_numberOptions & RejectGroupSeparator
? QLocalePrivate::FailOnGroupSeparators
: QLocalePrivate::ParseGroupSeparators;
- return d()->stringToLongLong(s, 10, ok, mode);
+ return d->stringToLongLong(s, 10, ok, mode);
}
/*!
@@ -1156,11 +1163,11 @@ qlonglong QLocale::toLongLong(const QString &s, bool *ok) const
qulonglong QLocale::toULongLong(const QString &s, bool *ok) const
{
QLocalePrivate::GroupSeparatorMode mode
- = p.numberOptions & RejectGroupSeparator
+ = d->m_numberOptions & RejectGroupSeparator
? QLocalePrivate::FailOnGroupSeparators
: QLocalePrivate::ParseGroupSeparators;
- return d()->stringToUnsLongLong(s, 10, ok, mode);
+ return d->stringToUnsLongLong(s, 10, ok, mode);
}
/*!
@@ -1202,7 +1209,7 @@ float QLocale::toFloat(const QString &s, bool *ok) const
the "C" locale if the string cannot be interpreted in this
locale.
- \snippet doc/src/snippets/code/src_corelib_tools_qlocale.cpp 3
+ \snippet code/src_corelib_tools_qlocale.cpp 3
Notice that the last conversion returns 1234.0, because '.' is the
thousands group separator in the German locale.
@@ -1215,11 +1222,11 @@ float QLocale::toFloat(const QString &s, bool *ok) const
double QLocale::toDouble(const QString &s, bool *ok) const
{
QLocalePrivate::GroupSeparatorMode mode
- = p.numberOptions & RejectGroupSeparator
+ = d->m_numberOptions & RejectGroupSeparator
? QLocalePrivate::FailOnGroupSeparators
: QLocalePrivate::ParseGroupSeparators;
- return d()->stringToDouble(s, ok, mode);
+ return d->stringToDouble(s, ok, mode);
}
/*!
@@ -1230,11 +1237,11 @@ double QLocale::toDouble(const QString &s, bool *ok) const
QString QLocale::toString(qlonglong i) const
{
- int flags = p.numberOptions & OmitGroupSeparator
+ int flags = d->m_numberOptions & OmitGroupSeparator
? 0
: QLocalePrivate::ThousandsGroup;
- return d()->longLongToString(i, -1, 10, -1, flags);
+ return d->longLongToString(i, -1, 10, -1, flags);
}
/*!
@@ -1245,11 +1252,11 @@ QString QLocale::toString(qlonglong i) const
QString QLocale::toString(qulonglong i) const
{
- int flags = p.numberOptions & OmitGroupSeparator
+ int flags = d->m_numberOptions & OmitGroupSeparator
? 0
: QLocalePrivate::ThousandsGroup;
- return d()->unsLongLongToString(i, -1, 10, -1, flags);
+ return d->unsLongLongToString(i, -1, 10, -1, flags);
}
/*!
@@ -1260,7 +1267,7 @@ QString QLocale::toString(qulonglong i) const
QString QLocale::toString(const QDate &date, const QString &format) const
{
- return d()->dateTimeToString(format, &date, 0, this);
+ return d->dateTimeToString(format, &date, 0, this);
}
/*!
@@ -1274,7 +1281,7 @@ QString QLocale::toString(const QDate &date, FormatType format) const
return QString();
#ifndef QT_NO_SYSTEMLOCALE
- if (d() == systemPrivate()) {
+ if (d->m_data == systemData()) {
QVariant res = systemLocale()->query(format == LongFormat
? QSystemLocale::DateToStringLong : QSystemLocale::DateToStringShort,
date);
@@ -1338,7 +1345,7 @@ static QString timeZone()
*/
QString QLocale::toString(const QTime &time, const QString &format) const
{
- return d()->dateTimeToString(format, 0, &time, this);
+ return d->dateTimeToString(format, 0, &time, this);
}
/*!
@@ -1353,7 +1360,7 @@ QString QLocale::toString(const QDateTime &dateTime, const QString &format) cons
{
const QDate dt = dateTime.date();
const QTime tm = dateTime.time();
- return d()->dateTimeToString(format, &dt, &tm, this);
+ return d->dateTimeToString(format, &dt, &tm, this);
}
/*!
@@ -1369,7 +1376,7 @@ QString QLocale::toString(const QDateTime &dateTime, FormatType format) const
return QString();
#ifndef QT_NO_SYSTEMLOCALE
- if (d() == systemPrivate()) {
+ if (d->m_data == systemData()) {
QVariant res = systemLocale()->query(format == LongFormat
? QSystemLocale::DateTimeToStringLong
: QSystemLocale::DateTimeToStringShort,
@@ -1395,7 +1402,7 @@ QString QLocale::toString(const QTime &time, FormatType format) const
return QString();
#ifndef QT_NO_SYSTEMLOCALE
- if (d() == systemPrivate()) {
+ if (d->m_data == systemData()) {
QVariant res = systemLocale()->query(format == LongFormat
? QSystemLocale::TimeToStringLong : QSystemLocale::TimeToStringShort,
time);
@@ -1422,7 +1429,7 @@ QString QLocale::toString(const QTime &time, FormatType format) const
QString QLocale::dateFormat(FormatType format) const
{
#ifndef QT_NO_SYSTEMLOCALE
- if (d() == systemPrivate()) {
+ if (d->m_data == systemData()) {
QVariant res = systemLocale()->query(format == LongFormat
? QSystemLocale::DateFormatLong : QSystemLocale::DateFormatShort,
QVariant());
@@ -1434,12 +1441,12 @@ QString QLocale::dateFormat(FormatType format) const
quint32 idx, size;
switch (format) {
case LongFormat:
- idx = d()->m_long_date_format_idx;
- size = d()->m_long_date_format_size;
+ idx = d->m_data->m_long_date_format_idx;
+ size = d->m_data->m_long_date_format_size;
break;
default:
- idx = d()->m_short_date_format_idx;
- size = d()->m_short_date_format_size;
+ idx = d->m_data->m_short_date_format_idx;
+ size = d->m_data->m_short_date_format_size;
break;
}
return getLocaleData(date_format_data + idx, size);
@@ -1459,7 +1466,7 @@ QString QLocale::dateFormat(FormatType format) const
QString QLocale::timeFormat(FormatType format) const
{
#ifndef QT_NO_SYSTEMLOCALE
- if (d() == systemPrivate()) {
+ if (d->m_data == systemData()) {
QVariant res = systemLocale()->query(format == LongFormat
? QSystemLocale::TimeFormatLong : QSystemLocale::TimeFormatShort,
QVariant());
@@ -1471,12 +1478,12 @@ QString QLocale::timeFormat(FormatType format) const
quint32 idx, size;
switch (format) {
case LongFormat:
- idx = d()->m_long_time_format_idx;
- size = d()->m_long_time_format_size;
+ idx = d->m_data->m_long_time_format_idx;
+ size = d->m_data->m_long_time_format_size;
break;
default:
- idx = d()->m_short_time_format_idx;
- size = d()->m_short_time_format_size;
+ idx = d->m_data->m_short_time_format_idx;
+ size = d->m_data->m_short_time_format_size;
break;
}
return getLocaleData(time_format_data + idx, size);
@@ -1496,7 +1503,7 @@ QString QLocale::timeFormat(FormatType format) const
QString QLocale::dateTimeFormat(FormatType format) const
{
#ifndef QT_NO_SYSTEMLOCALE
- if (d() == systemPrivate()) {
+ if (d->m_data == systemData()) {
QVariant res = systemLocale()->query(format == LongFormat
? QSystemLocale::DateTimeFormatLong
: QSystemLocale::DateTimeFormatShort,
@@ -1664,7 +1671,7 @@ QDateTime QLocale::toDateTime(const QString &string, const QString &format) cons
*/
QChar QLocale::decimalPoint() const
{
- return d()->decimal();
+ return d->decimal();
}
/*!
@@ -1674,7 +1681,7 @@ QChar QLocale::decimalPoint() const
*/
QChar QLocale::groupSeparator() const
{
- return d()->group();
+ return d->group();
}
/*!
@@ -1684,7 +1691,7 @@ QChar QLocale::groupSeparator() const
*/
QChar QLocale::percent() const
{
- return d()->percent();
+ return d->percent();
}
/*!
@@ -1694,7 +1701,7 @@ QChar QLocale::percent() const
*/
QChar QLocale::zeroDigit() const
{
- return d()->zero();
+ return d->zero();
}
/*!
@@ -1704,7 +1711,7 @@ QChar QLocale::zeroDigit() const
*/
QChar QLocale::negativeSign() const
{
- return d()->minus();
+ return d->minus();
}
/*!
@@ -1714,7 +1721,7 @@ QChar QLocale::negativeSign() const
*/
QChar QLocale::positiveSign() const
{
- return d()->plus();
+ return d->plus();
}
/*!
@@ -1724,7 +1731,7 @@ QChar QLocale::positiveSign() const
*/
QChar QLocale::exponential() const
{
- return d()->exponential();
+ return d->exponential();
}
static bool qIsUpper(char c)
@@ -1771,9 +1778,9 @@ QString QLocale::toString(double i, char f, int prec) const
break;
}
- if (!(p.numberOptions & OmitGroupSeparator))
+ if (!(d->m_numberOptions & OmitGroupSeparator))
flags |= QLocalePrivate::ThousandsGroup;
- return d()->doubleToString(i, prec, form, -1, flags);
+ return d->doubleToString(i, prec, form, -1, flags);
}
/*!
@@ -1796,7 +1803,8 @@ QString QLocale::toString(double i, char f, int prec) const
QLocale QLocale::system()
{
QLocale result(C);
- result.p.index = localePrivateIndex(systemPrivate());
+ result.d->m_index = localeDataIndex(systemData());
+ result.d->m_data = dataPointerHelper(result.d->m_index);
return result;
}
@@ -1819,17 +1827,18 @@ QList<QLocale> QLocale::matchingLocales(QLocale::Language language,
return QList<QLocale>();
QList<QLocale> result;
- const QLocalePrivate *d = locale_data;
+ const QLocaleData *data = locale_data;
if (language == QLocale::AnyLanguage && script == QLocale::AnyScript && country == QLocale::AnyCountry)
result.reserve(locale_data_size);
if (language != QLocale::C)
- d += locale_index[language];
- while ( (d != locale_data + locale_data_size)
- && (language == QLocale::AnyLanguage || d->m_language_id == uint(language))) {
+ data += locale_index[language];
+ while ( (data != locale_data + locale_data_size)
+ && (language == QLocale::AnyLanguage || data->m_language_id == uint(language))) {
QLocale locale(QLocale::C);
- locale.p.index = localePrivateIndex(d);
+ locale.d->m_index = localeDataIndex(data);
+ locale.d->m_data = dataPointerHelper(locale.d->m_index);
result.append(locale);
- ++d;
+ ++data;
}
return result;
}
@@ -1856,11 +1865,11 @@ QList<QLocale::Country> QLocale::countriesForLanguage(Language language)
return result;
}
- const QLocalePrivate *d = locale_data + idx;
+ const QLocaleData *data = locale_data + idx;
- while (d->languageId() == language_id) {
- result << static_cast<Country>(d->countryId());
- ++d;
+ while (data->m_language_id == language_id) {
+ result << static_cast<Country>(data->m_country_id);
+ ++data;
}
return result;
@@ -1880,7 +1889,7 @@ QString QLocale::monthName(int month, FormatType type) const
return QString();
#ifndef QT_NO_SYSTEMLOCALE
- if (d() == systemPrivate()) {
+ if (d->m_data == systemData()) {
QVariant res = systemLocale()->query(type == LongFormat
? QSystemLocale::MonthNameLong : QSystemLocale::MonthNameShort,
month);
@@ -1892,16 +1901,16 @@ QString QLocale::monthName(int month, FormatType type) const
quint32 idx, size;
switch (type) {
case QLocale::LongFormat:
- idx = d()->m_long_month_names_idx;
- size = d()->m_long_month_names_size;
+ idx = d->m_data->m_long_month_names_idx;
+ size = d->m_data->m_long_month_names_size;
break;
case QLocale::ShortFormat:
- idx = d()->m_short_month_names_idx;
- size = d()->m_short_month_names_size;
+ idx = d->m_data->m_short_month_names_idx;
+ size = d->m_data->m_short_month_names_size;
break;
case QLocale::NarrowFormat:
- idx = d()->m_narrow_month_names_idx;
- size = d()->m_narrow_month_names_size;
+ idx = d->m_data->m_narrow_month_names_idx;
+ size = d->m_data->m_narrow_month_names_size;
break;
default:
return QString();
@@ -1926,7 +1935,7 @@ QString QLocale::standaloneMonthName(int month, FormatType type) const
return QString();
#ifndef QT_NO_SYSTEMLOCALE
- if (d() == systemPrivate()) {
+ if (d->m_data == systemData()) {
QVariant res = systemLocale()->query(type == LongFormat
? QSystemLocale::MonthNameLong : QSystemLocale::MonthNameShort,
month);
@@ -1938,16 +1947,16 @@ QString QLocale::standaloneMonthName(int month, FormatType type) const
quint32 idx, size;
switch (type) {
case QLocale::LongFormat:
- idx = d()->m_standalone_long_month_names_idx;
- size = d()->m_standalone_long_month_names_size;
+ idx = d->m_data->m_standalone_long_month_names_idx;
+ size = d->m_data->m_standalone_long_month_names_size;
break;
case QLocale::ShortFormat:
- idx = d()->m_standalone_short_month_names_idx;
- size = d()->m_standalone_short_month_names_size;
+ idx = d->m_data->m_standalone_short_month_names_idx;
+ size = d->m_data->m_standalone_short_month_names_size;
break;
case QLocale::NarrowFormat:
- idx = d()->m_standalone_narrow_month_names_idx;
- size = d()->m_standalone_narrow_month_names_size;
+ idx = d->m_data->m_standalone_narrow_month_names_idx;
+ size = d->m_data->m_standalone_narrow_month_names_size;
break;
default:
return QString();
@@ -1973,7 +1982,7 @@ QString QLocale::dayName(int day, FormatType type) const
return QString();
#ifndef QT_NO_SYSTEMLOCALE
- if (d() == systemPrivate()) {
+ if (d->m_data == systemData()) {
QVariant res = systemLocale()->query(type == LongFormat
? QSystemLocale::DayNameLong : QSystemLocale::DayNameShort,
day);
@@ -1987,16 +1996,16 @@ QString QLocale::dayName(int day, FormatType type) const
quint32 idx, size;
switch (type) {
case QLocale::LongFormat:
- idx = d()->m_long_day_names_idx;
- size = d()->m_long_day_names_size;
+ idx = d->m_data->m_long_day_names_idx;
+ size = d->m_data->m_long_day_names_size;
break;
case QLocale::ShortFormat:
- idx = d()->m_short_day_names_idx;
- size = d()->m_short_day_names_size;
+ idx = d->m_data->m_short_day_names_idx;
+ size = d->m_data->m_short_day_names_size;
break;
case QLocale::NarrowFormat:
- idx = d()->m_narrow_day_names_idx;
- size = d()->m_narrow_day_names_size;
+ idx = d->m_data->m_narrow_day_names_idx;
+ size = d->m_data->m_narrow_day_names_size;
break;
default:
return QString();
@@ -2022,7 +2031,7 @@ QString QLocale::standaloneDayName(int day, FormatType type) const
return QString();
#ifndef QT_NO_SYSTEMLOCALE
- if (d() == systemPrivate()) {
+ if (d->m_data == systemData()) {
QVariant res = systemLocale()->query(type == LongFormat
? QSystemLocale::DayNameLong : QSystemLocale::DayNameShort,
day);
@@ -2036,16 +2045,16 @@ QString QLocale::standaloneDayName(int day, FormatType type) const
quint32 idx, size;
switch (type) {
case QLocale::LongFormat:
- idx = d()->m_standalone_long_day_names_idx;
- size = d()->m_standalone_long_day_names_size;
+ idx = d->m_data->m_standalone_long_day_names_idx;
+ size = d->m_data->m_standalone_long_day_names_size;
break;
case QLocale::ShortFormat:
- idx = d()->m_standalone_short_day_names_idx;
- size = d()->m_standalone_short_day_names_size;
+ idx = d->m_data->m_standalone_short_day_names_idx;
+ size = d->m_data->m_standalone_short_day_names_size;
break;
case QLocale::NarrowFormat:
- idx = d()->m_standalone_narrow_day_names_idx;
- size = d()->m_standalone_narrow_day_names_size;
+ idx = d->m_data->m_standalone_narrow_day_names_idx;
+ size = d->m_data->m_standalone_narrow_day_names_size;
break;
default:
return QString();
@@ -2064,20 +2073,20 @@ QString QLocale::standaloneDayName(int day, FormatType type) const
Qt::DayOfWeek QLocale::firstDayOfWeek() const
{
#ifndef QT_NO_SYSTEMLOCALE
- if (d() == systemPrivate()) {
+ if (d->m_data == systemData()) {
QVariant res = systemLocale()->query(QSystemLocale::FirstDayOfWeek, QVariant());
if (!res.isNull())
return static_cast<Qt::DayOfWeek>(res.toUInt());
}
#endif
- return static_cast<Qt::DayOfWeek>(d()->m_first_day_of_week);
+ return static_cast<Qt::DayOfWeek>(d->m_data->m_first_day_of_week);
}
QLocale::MeasurementSystem QLocalePrivate::measurementSystem() const
{
for (int i = 0; i < ImperialMeasurementSystemsCount; ++i) {
- if (ImperialMeasurementSystems[i].languageId == m_language_id
- && ImperialMeasurementSystems[i].countryId == m_country_id) {
+ if (ImperialMeasurementSystems[i].languageId == m_data->m_language_id
+ && ImperialMeasurementSystems[i].countryId == m_data->m_country_id) {
return ImperialMeasurementSystems[i].system;
}
}
@@ -2092,15 +2101,15 @@ QLocale::MeasurementSystem QLocalePrivate::measurementSystem() const
QList<Qt::DayOfWeek> QLocale::weekdays() const
{
#ifndef QT_NO_SYSTEMLOCALE
- if (d() == systemPrivate()) {
+ if (d->m_data == systemData()) {
QVariant res = systemLocale()->query(QSystemLocale::Weekdays, QVariant());
if (!res.isNull())
return static_cast<QList<Qt::DayOfWeek> >(res.value<QList<Qt::DayOfWeek> >());
}
#endif
QList<Qt::DayOfWeek> weekdays;
- quint16 weekendStart = d()->m_weekend_start;
- quint16 weekendEnd = d()->m_weekend_end;
+ quint16 weekendStart = d->m_data->m_weekend_start;
+ quint16 weekendEnd = d->m_data->m_weekend_end;
for (int day = Qt::Monday; day <= Qt::Sunday; day++) {
if ((weekendEnd >= weekendStart && (day < weekendStart || day > weekendEnd)) ||
(weekendEnd < weekendStart && (day > weekendEnd && day < weekendStart)))
@@ -2117,14 +2126,14 @@ QList<Qt::DayOfWeek> QLocale::weekdays() const
QLocale::MeasurementSystem QLocale::measurementSystem() const
{
#ifndef QT_NO_SYSTEMLOCALE
- if (d() == systemPrivate()) {
+ if (d->m_data == systemData()) {
QVariant res = systemLocale()->query(QSystemLocale::MeasurementSystem, QVariant());
if (!res.isNull())
return MeasurementSystem(res.toInt());
}
#endif
- return d()->measurementSystem();
+ return d->measurementSystem();
}
/*!
@@ -2193,13 +2202,13 @@ QString QLocale::toLower(const QString &str) const
QString QLocale::amText() const
{
#ifndef QT_NO_SYSTEMLOCALE
- if (d() == systemPrivate()) {
+ if (d->m_data == systemData()) {
QVariant res = systemLocale()->query(QSystemLocale::AMText, QVariant());
if (!res.isNull())
return res.toString();
}
#endif
- return getLocaleData(am_data + d()->m_am_idx, d()->m_am_size);
+ return getLocaleData(am_data + d->m_data->m_am_idx, d->m_data->m_am_size);
}
/*!
@@ -2213,13 +2222,13 @@ QString QLocale::amText() const
QString QLocale::pmText() const
{
#ifndef QT_NO_SYSTEMLOCALE
- if (d() == systemPrivate()) {
+ if (d->m_data == systemData()) {
QVariant res = systemLocale()->query(QSystemLocale::PMText, QVariant());
if (!res.isNull())
return res.toString();
}
#endif
- return getLocaleData(pm_data + d()->m_pm_idx, d()->m_pm_size);
+ return getLocaleData(pm_data + d->m_data->m_pm_idx, d->m_data->m_pm_size);
}
@@ -3098,7 +3107,7 @@ qulonglong QLocalePrivate::bytearrayToUnsLongLong(const char *num, int base, boo
QString QLocale::currencySymbol(QLocale::CurrencySymbolFormat format) const
{
#ifndef QT_NO_SYSTEMLOCALE
- if (d() == systemPrivate()) {
+ if (d->m_data == systemData()) {
QVariant res = systemLocale()->query(QSystemLocale::CurrencySymbol, format);
if (!res.isNull())
return res.toString();
@@ -3107,20 +3116,20 @@ QString QLocale::currencySymbol(QLocale::CurrencySymbolFormat format) const
quint32 idx, size;
switch (format) {
case CurrencySymbol:
- idx = d()->m_currency_symbol_idx;
- size = d()->m_currency_symbol_size;
+ idx = d->m_data->m_currency_symbol_idx;
+ size = d->m_data->m_currency_symbol_size;
return getLocaleData(currency_symbol_data + idx, size);
case CurrencyDisplayName:
- idx = d()->m_currency_display_name_idx;
- size = d()->m_currency_display_name_size;
+ idx = d->m_data->m_currency_display_name_idx;
+ size = d->m_data->m_currency_display_name_size;
return getLocaleListData(currency_display_name_data + idx, size, 0);
case CurrencyIsoCode: {
int len = 0;
- const QLocalePrivate *d = this->d();
+ const QLocaleData *data = this->d->m_data;
for (; len < 3; ++len)
- if (!d->m_currency_iso_code[len])
+ if (!data->m_currency_iso_code[len])
break;
- return len ? QString::fromLatin1(d->m_currency_iso_code, len) : QString();
+ return len ? QString::fromLatin1(data->m_currency_iso_code, len) : QString();
}
}
return QString();
@@ -3137,19 +3146,19 @@ QString QLocale::currencySymbol(QLocale::CurrencySymbolFormat format) const
QString QLocale::toCurrencyString(qlonglong value, const QString &symbol) const
{
#ifndef QT_NO_SYSTEMLOCALE
- if (d() == systemPrivate()) {
+ if (d->m_data == systemData()) {
QSystemLocale::CurrencyToStringArgument arg(value, symbol);
QVariant res = systemLocale()->query(QSystemLocale::CurrencyToString, QVariant::fromValue(arg));
if (!res.isNull())
return res.toString();
}
#endif
- const QLocalePrivate *d = this->d();
- quint8 idx = d->m_currency_format_idx;
- quint8 size = d->m_currency_format_size;
- if (d->m_currency_negative_format_size && value < 0) {
- idx = d->m_currency_negative_format_idx;
- size = d->m_currency_negative_format_size;
+ const QLocalePrivate *d = this->d;
+ quint8 idx = d->m_data->m_currency_format_idx;
+ quint8 size = d->m_data->m_currency_format_size;
+ if (d->m_data->m_currency_negative_format_size && value < 0) {
+ idx = d->m_data->m_currency_negative_format_idx;
+ size = d->m_data->m_currency_negative_format_size;
value = -value;
}
QString str = d->longLongToString(value);
@@ -3167,16 +3176,16 @@ QString QLocale::toCurrencyString(qlonglong value, const QString &symbol) const
QString QLocale::toCurrencyString(qulonglong value, const QString &symbol) const
{
#ifndef QT_NO_SYSTEMLOCALE
- if (d() == systemPrivate()) {
+ if (d->m_data == systemData()) {
QSystemLocale::CurrencyToStringArgument arg(value, symbol);
QVariant res = systemLocale()->query(QSystemLocale::CurrencyToString, QVariant::fromValue(arg));
if (!res.isNull())
return res.toString();
}
#endif
- const QLocalePrivate *d = this->d();
- quint8 idx = d->m_currency_format_idx;
- quint8 size = d->m_currency_format_size;
+ const QLocaleData *data = this->d->m_data;
+ quint8 idx = data->m_currency_format_idx;
+ quint8 size = data->m_currency_format_size;
QString str = d->unsLongLongToString(value);
QString sym = symbol.isNull() ? currencySymbol() : symbol;
if (sym.isEmpty())
@@ -3192,22 +3201,22 @@ QString QLocale::toCurrencyString(qulonglong value, const QString &symbol) const
QString QLocale::toCurrencyString(double value, const QString &symbol) const
{
#ifndef QT_NO_SYSTEMLOCALE
- if (d() == systemPrivate()) {
+ if (d->m_data == systemData()) {
QSystemLocale::CurrencyToStringArgument arg(value, symbol);
QVariant res = systemLocale()->query(QSystemLocale::CurrencyToString, QVariant::fromValue(arg));
if (!res.isNull())
return res.toString();
}
#endif
- const QLocalePrivate *d = this->d();
- quint8 idx = d->m_currency_format_idx;
- quint8 size = d->m_currency_format_size;
- if (d->m_currency_negative_format_size && value < 0) {
- idx = d->m_currency_negative_format_idx;
- size = d->m_currency_negative_format_size;
+ const QLocaleData *data = this->d->m_data;
+ quint8 idx = data->m_currency_format_idx;
+ quint8 size = data->m_currency_format_size;
+ if (data->m_currency_negative_format_size && value < 0) {
+ idx = data->m_currency_negative_format_idx;
+ size = data->m_currency_negative_format_size;
value = -value;
}
- QString str = d->doubleToString(value, d->m_currency_digits,
+ QString str = d->doubleToString(value, d->m_data->m_currency_digits,
QLocalePrivate::DFDecimal);
QString sym = symbol.isNull() ? currencySymbol() : symbol;
if (sym.isEmpty())
@@ -3235,7 +3244,7 @@ QString QLocale::toCurrencyString(double value, const QString &symbol) const
QStringList QLocale::uiLanguages() const
{
#ifndef QT_NO_SYSTEMLOCALE
- if (d() == systemPrivate()) {
+ if (d->m_data == systemData()) {
QVariant res = systemLocale()->query(QSystemLocale::UILanguages, QVariant());
if (!res.isNull()) {
QStringList result = res.toStringList();
@@ -3258,13 +3267,13 @@ QStringList QLocale::uiLanguages() const
QString QLocale::nativeLanguageName() const
{
#ifndef QT_NO_SYSTEMLOCALE
- if (d() == systemPrivate()) {
+ if (d->m_data == systemData()) {
QVariant res = systemLocale()->query(QSystemLocale::NativeLanguageName, QVariant());
if (!res.isNull())
return res.toString();
}
#endif
- return getLocaleData(endonyms_data + d()->m_language_endonym_idx, d()->m_language_endonym_size);
+ return getLocaleData(endonyms_data + d->m_data->m_language_endonym_idx, d->m_data->m_language_endonym_size);
}
/*!
@@ -3278,13 +3287,13 @@ QString QLocale::nativeLanguageName() const
QString QLocale::nativeCountryName() const
{
#ifndef QT_NO_SYSTEMLOCALE
- if (d() == systemPrivate()) {
+ if (d->m_data == systemData()) {
QVariant res = systemLocale()->query(QSystemLocale::NativeCountryName, QVariant());
if (!res.isNull())
return res.toString();
}
#endif
- return getLocaleData(endonyms_data + d()->m_country_endonym_idx, d()->m_country_endonym_size);
+ return getLocaleData(endonyms_data + d->m_data->m_country_endonym_idx, d->m_data->m_country_endonym_size);
}
#ifndef QT_NO_DEBUG_STREAM