mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-24 19:02:59 +00:00
use correct QString constructs in QLocale and QLocalePrivate
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
574064ec04
commit
cc9ccc9974
1 changed files with 12 additions and 12 deletions
|
@ -86,7 +86,7 @@ QLocale::Language QLocalePrivate::codeToLanguage(const QString &code)
|
||||||
}
|
}
|
||||||
|
|
||||||
for (qint16 i = 0; i < languageTblSize; i++) {
|
for (qint16 i = 0; i < languageTblSize; i++) {
|
||||||
if (QString::fromLatin1(languageTbl[i].code) == lower)
|
if (QLatin1String(languageTbl[i].code) == lower)
|
||||||
return languageTbl[i].language;
|
return languageTbl[i].language;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -109,7 +109,7 @@ QLocale::Script QLocalePrivate::codeToScript(const QString &code)
|
||||||
}
|
}
|
||||||
|
|
||||||
for (qint16 i = 0; i < scriptTblSize; i++) {
|
for (qint16 i = 0; i < scriptTblSize; i++) {
|
||||||
if (QString::fromLatin1(scriptTbl[i].code) == title)
|
if (QLatin1String(scriptTbl[i].code) == title)
|
||||||
return scriptTbl[i].script;
|
return scriptTbl[i].script;
|
||||||
}
|
}
|
||||||
return QLocale::AnyScript;
|
return QLocale::AnyScript;
|
||||||
|
@ -127,7 +127,7 @@ QLocale::Country QLocalePrivate::codeToCountry(const QString &code)
|
||||||
}
|
}
|
||||||
|
|
||||||
for (qint16 i = 0; i < countryTblSize; i++) {
|
for (qint16 i = 0; i < countryTblSize; i++) {
|
||||||
if (QString::fromLatin1(countryTbl[i].code) == upper)
|
if (QLatin1String(countryTbl[i].code) == upper)
|
||||||
return countryTbl[i].country;
|
return countryTbl[i].country;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -827,9 +827,9 @@ QString QLocale::name() const
|
||||||
const char *lang = languageTbl[dd->m_language].code;
|
const char *lang = languageTbl[dd->m_language].code;
|
||||||
if (dd->m_country != AnyCountry) {
|
if (dd->m_country != AnyCountry) {
|
||||||
const char *country = countryTbl[dd->m_country].code;
|
const char *country = countryTbl[dd->m_country].code;
|
||||||
return QString::fromLatin1(lang) + QLatin1Char('_') + QString::fromLatin1(country);
|
return QLatin1String(lang) + QLatin1Char('_') + QLatin1String(country);
|
||||||
}
|
}
|
||||||
return QString::fromLatin1(lang);
|
return QLatin1String(lang);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
@ -2252,11 +2252,11 @@ QString QLocalePrivate::doubleToString(const QChar _zero, const QChar plus, cons
|
||||||
|
|
||||||
// Detect special numbers (nan, +/-inf)
|
// Detect special numbers (nan, +/-inf)
|
||||||
if (qIsInf(d)) {
|
if (qIsInf(d)) {
|
||||||
num_str = QString::fromLatin1("inf");
|
num_str = QLatin1String("inf");
|
||||||
special_number = true;
|
special_number = true;
|
||||||
negative = d < 0;
|
negative = d < 0;
|
||||||
} else if (qIsNaN(d)) {
|
} else if (qIsNaN(d)) {
|
||||||
num_str = QString::fromLatin1("nan");
|
num_str = QLatin1String("nan");
|
||||||
special_number = true;
|
special_number = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2268,9 +2268,9 @@ QString QLocalePrivate::doubleToString(const QChar _zero, const QChar plus, cons
|
||||||
// NOT thread safe!
|
// NOT thread safe!
|
||||||
if (form == DFDecimal) {
|
if (form == DFDecimal) {
|
||||||
#ifdef QT_HAVE_FCVT
|
#ifdef QT_HAVE_FCVT
|
||||||
digits = QLatin1String(::fcvt(d, precision, &decpt, &sign));
|
digits = QString::fromLatin1(::fcvt(d, precision, &decpt, &sign));
|
||||||
#else
|
#else
|
||||||
digits = QLatin1String(qfcvt(d, precision, &decpt, &sign));
|
digits = QString::fromLatin1(qfcvt(d, precision, &decpt, &sign));
|
||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
int pr = precision;
|
int pr = precision;
|
||||||
|
@ -2279,9 +2279,9 @@ QString QLocalePrivate::doubleToString(const QChar _zero, const QChar plus, cons
|
||||||
else if (form == DFSignificantDigits && pr == 0)
|
else if (form == DFSignificantDigits && pr == 0)
|
||||||
pr = 1;
|
pr = 1;
|
||||||
#ifdef QT_HAVE_ECVT
|
#ifdef QT_HAVE_ECVT
|
||||||
digits = QLatin1String(::ecvt(d, pr, &decpt, &sign));
|
digits = QString::fromLatin1(::ecvt(d, pr, &decpt, &sign));
|
||||||
#else
|
#else
|
||||||
digits = QLatin1String(qecvt(d, pr, &decpt, &sign));
|
digits = QString::fromLatin1(qecvt(d, pr, &decpt, &sign));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Chop trailing zeros
|
// Chop trailing zeros
|
||||||
|
@ -2857,7 +2857,7 @@ QString QLocale::currencySymbol(QLocale::CurrencySymbolFormat format) const
|
||||||
case CurrencyDisplayName:
|
case CurrencyDisplayName:
|
||||||
return getLocaleData(d()->m_currency_display_name);
|
return getLocaleData(d()->m_currency_display_name);
|
||||||
case CurrencyIsoCode: {
|
case CurrencyIsoCode: {
|
||||||
return QString::fromLatin1(d()->m_currency_iso_code);
|
return QString::fromUtf8(d()->m_currency_iso_code);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return QString();
|
return QString();
|
||||||
|
|
Loading…
Add table
Reference in a new issue