From cc94a1c845c033080de85646e0e2a9100ff4c938 Mon Sep 17 00:00:00 2001 From: Mike FABIAN Date: Mon, 4 Jun 2012 17:08:27 +0200 Subject: [PATCH] Rename QSystemLocale::fallbackLocale() to QSystemLocale::fallbackUiLocale() Suggested by Oswald Buddenhagen. This function is about the (main) UI language, not about other locale features like number formatting etc. It not in the public API anymore in Qt 5.0 so it can be renamed. Change-Id: I2a23892c67e5813de4c0e57330749568777e9ee6 Reviewed-by: Oswald Buddenhagen Reviewed-by: Lars Knoll --- src/corelib/tools/qlocale.cpp | 4 ++-- src/corelib/tools/qlocale.qdoc | 2 +- src/corelib/tools/qlocale_mac.mm | 2 +- src/corelib/tools/qlocale_p.h | 2 +- src/corelib/tools/qlocale_unix.cpp | 2 +- src/corelib/tools/qlocale_win.cpp | 4 ++-- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/corelib/tools/qlocale.cpp b/src/corelib/tools/qlocale.cpp index d799b81..67e47e5 100644 --- a/src/corelib/tools/qlocale.cpp +++ b/src/corelib/tools/qlocale.cpp @@ -480,7 +480,7 @@ void QLocalePrivate::updateSystemPrivate() // tell the object that the system locale has changed. sys_locale->query(QSystemLocale::LocaleChanged, QVariant()); - *system_data = *sys_locale->fallbackLocale().d->m_data; + *system_data = *sys_locale->fallbackUiLocale().d->m_data; QVariant res = sys_locale->query(QSystemLocale::LanguageId, QVariant()); if (!res.isNull()) { @@ -518,7 +518,7 @@ void QLocalePrivate::updateSystemPrivate() #ifdef QT_USE_ICU if (!default_data) - qt_initIcu(sys_locale->fallbackLocale().bcp47Name()); + qt_initIcu(sys_locale->fallbackUiLocale().bcp47Name()); #endif } diff --git a/src/corelib/tools/qlocale.qdoc b/src/corelib/tools/qlocale.qdoc index ed80984..daf2487 100644 --- a/src/corelib/tools/qlocale.qdoc +++ b/src/corelib/tools/qlocale.qdoc @@ -776,7 +776,7 @@ */ /*! - \fn QLocale QSystemLocale::fallbackLocale() const + \fn QLocale QSystemLocale::fallbackUiLocale() const \since 4.6 Returns the fallback locale obtained from the system. diff --git a/src/corelib/tools/qlocale_mac.mm b/src/corelib/tools/qlocale_mac.mm index 7153875..0a74332 100644 --- a/src/corelib/tools/qlocale_mac.mm +++ b/src/corelib/tools/qlocale_mac.mm @@ -370,7 +370,7 @@ static QVariant macQuoteString(QSystemLocale::QueryType type, const QStringRef & #ifndef QT_NO_SYSTEMLOCALE -QLocale QSystemLocale::fallbackLocale() const +QLocale QSystemLocale::fallbackUiLocale() const { return QLocale(QString::fromUtf8(getMacLocaleName().constData())); } diff --git a/src/corelib/tools/qlocale_p.h b/src/corelib/tools/qlocale_p.h index 6731355..c2c1488 100644 --- a/src/corelib/tools/qlocale_p.h +++ b/src/corelib/tools/qlocale_p.h @@ -118,7 +118,7 @@ public: NativeCountryName // QString }; virtual QVariant query(QueryType type, QVariant in) const; - virtual QLocale fallbackLocale() const; + virtual QLocale fallbackUiLocale() const; private: QSystemLocale(bool); diff --git a/src/corelib/tools/qlocale_unix.cpp b/src/corelib/tools/qlocale_unix.cpp index d46ced4..9c84155 100644 --- a/src/corelib/tools/qlocale_unix.cpp +++ b/src/corelib/tools/qlocale_unix.cpp @@ -110,7 +110,7 @@ Q_GLOBAL_STATIC(QSystemLocaleData, qSystemLocaleData) #ifndef QT_NO_SYSTEMLOCALE -QLocale QSystemLocale::fallbackLocale() const +QLocale QSystemLocale::fallbackUiLocale() const { QByteArray lang = qgetenv("LC_ALL"); if (lang.isEmpty()) diff --git a/src/corelib/tools/qlocale_win.cpp b/src/corelib/tools/qlocale_win.cpp index e787f2f..067338c 100644 --- a/src/corelib/tools/qlocale_win.cpp +++ b/src/corelib/tools/qlocale_win.cpp @@ -653,7 +653,7 @@ QString QSystemLocalePrivate::winToQtFormat(const QString &sys_fmt) return result; } -QLocale QSystemLocale::fallbackLocale() const +QLocale QSystemLocale::fallbackUiLocale() const { return QLocale(QString::fromLatin1(getWinLocaleName())); } @@ -714,7 +714,7 @@ QVariant QSystemLocale::query(QueryType type, QVariant in = QVariant()) const if (type == LanguageId) return lang; if (cntry == QLocale::AnyCountry) - return fallbackLocale().country(); + return fallbackUiLocale().country(); return cntry; } case ScriptId: -- 2.7.4