From 4b09e9cbfce4df05f187e6f399738219d3f2853e Mon Sep 17 00:00:00 2001 From: Denis Dzyubenko Date: Fri, 25 Feb 2011 13:39:14 +0100 Subject: Improved QLocale api Renames FormatCurrency enum value to CurrencyToString to match other enums. Task-number: related to QTBUG-17100 Reviewed-by: trustme --- src/corelib/tools/qlocale.cpp | 6 +++--- src/corelib/tools/qlocale.h | 2 +- src/corelib/tools/qlocale.qdoc | 2 +- src/corelib/tools/qlocale_mac.mm | 2 +- src/corelib/tools/qlocale_unix.cpp | 2 +- src/corelib/tools/qlocale_win.cpp | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/corelib/tools/qlocale.cpp b/src/corelib/tools/qlocale.cpp index bd23a22..e10ca8a 100644 --- a/src/corelib/tools/qlocale.cpp +++ b/src/corelib/tools/qlocale.cpp @@ -2881,7 +2881,7 @@ QString QLocale::toCurrencyString(qlonglong value) const { #ifndef QT_NO_SYSTEMLOCALE if (d() == systemPrivate()) { - QVariant res = systemLocale()->query(QSystemLocale::FormatCurrency, value); + QVariant res = systemLocale()->query(QSystemLocale::CurrencyToString, value); if (!res.isNull()) return res.toString(); } @@ -2910,7 +2910,7 @@ QString QLocale::toCurrencyString(qulonglong value) const { #ifndef QT_NO_SYSTEMLOCALE if (d() == systemPrivate()) { - QVariant res = systemLocale()->query(QSystemLocale::FormatCurrency, value); + QVariant res = systemLocale()->query(QSystemLocale::CurrencyToString, value); if (!res.isNull()) return res.toString(); } @@ -2930,7 +2930,7 @@ QString QLocale::toCurrencyString(double value) const { #ifndef QT_NO_SYSTEMLOCALE if (d() == systemPrivate()) { - QVariant res = systemLocale()->query(QSystemLocale::FormatCurrency, value); + QVariant res = systemLocale()->query(QSystemLocale::CurrencyToString, value); if (!res.isNull()) return res.toString(); } diff --git a/src/corelib/tools/qlocale.h b/src/corelib/tools/qlocale.h index 40c7d7e..a733732 100644 --- a/src/corelib/tools/qlocale.h +++ b/src/corelib/tools/qlocale.h @@ -99,7 +99,7 @@ public: WeekendStart, // Qt::DayOfWeek WeekendEnd, // Qt::DayOfWeek CurrencySymbol, // QString in: format - FormatCurrency, // QString in: qlonglong, qulonglong or double + CurrencyToString, // QString in: qlonglong, qulonglong or double UILanguages, // QStringList QuotationBegin, // QString in: StandardQuotation or AlternateQuotation QuotationEnd // QString in: StandardQuotation or AlternateQuotation diff --git a/src/corelib/tools/qlocale.qdoc b/src/corelib/tools/qlocale.qdoc index 8c036c3..5154324 100644 --- a/src/corelib/tools/qlocale.qdoc +++ b/src/corelib/tools/qlocale.qdoc @@ -708,7 +708,7 @@ \value PMText a string that represents the system PM designator associated with a 12-hour clock. \value FirstDayOfWeek a Qt::DayOfWeek enum specifiying the first day of the week \value CurrencySymbol a string that represents a currency in a format QLocale::CurrencyFormat. - \value FormatCurrency a localized string representation of a number with a currency symbol. + \value CurrencyToString a localized string representation of a number with a currency symbol. \value UILanguages a list of strings representing locale names that could be used for UI translation. \value QuotationBegin a QString specifying the start of a quotation. the in variant contains a QLocale::QuotationStyle \value QuotationEnd a QString specifying the end of a quotation. the in variant contains a QLocale::QuotationStyle diff --git a/src/corelib/tools/qlocale_mac.mm b/src/corelib/tools/qlocale_mac.mm index 0126a28..b8420e0 100644 --- a/src/corelib/tools/qlocale_mac.mm +++ b/src/corelib/tools/qlocale_mac.mm @@ -460,7 +460,7 @@ QVariant QSystemLocale::query(QueryType type, QVariant in = QVariant()) const return QVariant(macFirstDayOfWeek()); case CurrencySymbol: return QVariant(macCurrencySymbol(QLocale::CurrencySymbolFormat(in.toUInt()))); - case FormatCurrency: + case CurrencyToString: return macFormatCurrency(in); case UILanguages: { QCFType languages = (CFArrayRef)CFPreferencesCopyValue( diff --git a/src/corelib/tools/qlocale_unix.cpp b/src/corelib/tools/qlocale_unix.cpp index b3bda3a..6faaf19 100644 --- a/src/corelib/tools/qlocale_unix.cpp +++ b/src/corelib/tools/qlocale_unix.cpp @@ -165,7 +165,7 @@ QVariant QSystemLocale::query(QueryType type, QVariant in) const return lc_time.firstDayOfWeek(); case CurrencySymbol: return lc_monetary.currencySymbol(QLocale::CurrencySymbolFormat(in.toUInt())); - case FormatCurrency: { + case CurrencyToString: { switch (in.type()) { case QVariant::Int: return lc_monetary.toCurrencyString(in.toInt()); diff --git a/src/corelib/tools/qlocale_win.cpp b/src/corelib/tools/qlocale_win.cpp index 3605e44..cf84094 100644 --- a/src/corelib/tools/qlocale_win.cpp +++ b/src/corelib/tools/qlocale_win.cpp @@ -539,7 +539,7 @@ QVariant QSystemLocale::query(QueryType type, QVariant in = QVariant()) const return QVariant(winSystemFirstDayOfWeek()); case CurrencySymbol: return QVariant(winCurrencySymbol(QLocale::CurrencySymbolFormat(in.toUInt()))); - case FormatCurrency: + case CurrencyToString: return QVariant(winFormatCurrency(in)); case UILanguages: return QVariant(winUILanguages()); -- cgit v0.12