@@ -21,7 +21,6 @@
22#include "LocalePlugin.h"
22#include "LocalePlugin.h"
25class LocalePrivate {
24class LocalePrivate {
27 LocalePrivate() {
26 LocalePrivate() {
@@ -274,14 +273,253 @@ public:
274 {QLocale::Tonga, gettext("Tonga")},
273 {QLocale::Tonga, gettext("Tonga")},
275 {QLocale::Kosovo, gettext("Kosovo")},
274 {QLocale::Kosovo, gettext("Kosovo")},
276 {QLocale::WallisAndFutunaIslands, gettext("Wallis And Futuna Islands")} });
275 {QLocale::WallisAndFutunaIslands, gettext("Wallis And Futuna Islands")} });
277+ m_mccCodes = QHash<int, QString>
279− QString countryToString(QLocale::Country c) {
512+ QString countryToString(QLocale::Country c) const {
280 return m_countryNames.value(c);
513 return m_countryNames.value(c);
516+ QString mccToCountryCode(int mcc) const {
517+ return m_mccCodes.value(mcc, "us").toUpper();
284 QHash<QLocale::Country, QString> m_countryNames;
521 QHash<QLocale::Country, QString> m_countryNames;
522+ QHash<int,QString> m_mccCodes;
287Q_GLOBAL_STATIC(LocalePrivate, d)
525Q_GLOBAL_STATIC(LocalePrivate, d)
@@ -348,6 +586,10 @@ QString LocaleAttached::qlocToCountryCode(QLocale::Country c)
348 return QString();
586 return QString();
589+QString LocaleAttached::mccToCountryCode(int mcc) const
591+ return d->mccToCountryCode(mcc);
352LocalePlugin::LocalePlugin(QObject* parent)
594LocalePlugin::LocalePlugin(QObject* parent)
353 : QObject(parent)
595 : QObject(parent)