diff options
author | Thiago Macieira <thiago.macieira@nokia.com> | 2010-02-14 07:34:14 (GMT) |
---|---|---|
committer | Thiago Macieira <thiago.macieira@nokia.com> | 2010-02-14 07:34:28 (GMT) |
commit | c786e0cd3c40193073ce2f59f98a4d83bbe1a9b9 (patch) | |
tree | ac71d74f93ab340412f39f1086aff4db55881981 /src/corelib | |
parent | 9e5176070cdeba3e96f1969cfbb71bbd407a651e (diff) | |
download | Qt-c786e0cd3c40193073ce2f59f98a4d83bbe1a9b9.zip Qt-c786e0cd3c40193073ce2f59f98a4d83bbe1a9b9.tar.gz Qt-c786e0cd3c40193073ce2f59f98a4d83bbe1a9b9.tar.bz2 |
Don't use QSystemLocale if QT_NO_SYSTEMLOCALE (like QWS)
Reviewed-By: Trust Me
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/tools/qlocale.cpp | 63 |
1 files changed, 31 insertions, 32 deletions
diff --git a/src/corelib/tools/qlocale.cpp b/src/corelib/tools/qlocale.cpp index dd41154..9625228 100644 --- a/src/corelib/tools/qlocale.cpp +++ b/src/corelib/tools/qlocale.cpp @@ -1324,12 +1324,10 @@ QVariant QSystemLocale::query(QueryType /* type */, QVariant /* in */) const #endif -#ifndef QT_NO_SYSTEMLOCALE static QSystemLocale *_systemLocale = 0; Q_GLOBAL_STATIC_WITH_ARGS(QSystemLocale, QSystemLocale_globalSystemLocale, (true)) static QLocalePrivate *system_lp = 0; Q_GLOBAL_STATIC(QLocalePrivate, globalLocalePrivate) -#endif /****************************************************************************** ** Default system locale behavior @@ -1425,36 +1423,7 @@ static const QSystemLocale *systemLocale() return QSystemLocale_globalSystemLocale(); } -// returns the private data for the system locale. Cached data will not be -// initialized until the updateSystemPrivate is called. -static const QLocalePrivate *systemPrivate() -{ -#ifndef QT_NO_SYSTEMLOCALE - if (!system_lp) { - system_lp = globalLocalePrivate(); - // mark the locale as uninitialized system locale - system_lp->m_language_id = 0; - } - return system_lp; -#else - return locale_data; -#endif -} - -#ifndef QT_NO_SYSTEMLOCALE -static const QLocalePrivate *maybeSystemPrivate() -{ - return system_lp; -} -#endif - -static const QLocalePrivate *defaultPrivate() -{ - if (!default_lp) - default_lp = systemPrivate(); - return default_lp; -} - +static const QLocalePrivate *maybeSystemPrivate(); bool QLocalePrivate::isUninitializedSystemLocale() const { return this == maybeSystemPrivate() && m_language_id == 0; @@ -1516,6 +1485,36 @@ void QLocalePrivate::updateSystemPrivate() } #endif +// returns the private data for the system locale. Cached data will not be +// initialized until the updateSystemPrivate is called. +static const QLocalePrivate *systemPrivate() +{ +#ifndef QT_NO_SYSTEMLOCALE + if (!system_lp) { + system_lp = globalLocalePrivate(); + // mark the locale as uninitialized system locale + system_lp->m_language_id = 0; + } + return system_lp; +#else + return locale_data; +#endif +} + +#ifndef QT_NO_SYSTEMLOCALE +static const QLocalePrivate *maybeSystemPrivate() +{ + return system_lp; +} +#endif + +static const QLocalePrivate *defaultPrivate() +{ + if (!default_lp) + default_lp = systemPrivate(); + return default_lp; +} + static QString getLocaleListData(const ushort *data, int size, int index) { static const ushort separator = ';'; |