From 8df589bebca135bd9ba0c7c65c9aba052e2dd637 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 31 Aug 2011 10:32:41 +0200 Subject: Make QLocale not depend on being friends with the global static Don't assume that the global static is a function. Instead, create a class that is friends. Change-Id: I992f4d819b367899b19d95b4983e6b243f0ed932 Reviewed-by: Lars Knoll --- src/corelib/tools/qlocale.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'src/corelib/tools/qlocale.cpp') diff --git a/src/corelib/tools/qlocale.cpp b/src/corelib/tools/qlocale.cpp index 086ca7bd38..e40917c5d8 100644 --- a/src/corelib/tools/qlocale.cpp +++ b/src/corelib/tools/qlocale.cpp @@ -46,13 +46,6 @@ #include "qglobal.h" -#ifndef QT_NO_SYSTEMLOCALE -QT_BEGIN_NAMESPACE -class QSystemLocale; -static QSystemLocale *QSystemLocale_globalSystemLocale(); -QT_END_NAMESPACE -#endif - #include "qplatformdefs.h" #include "qdatastream.h" @@ -78,7 +71,13 @@ QT_BEGIN_NAMESPACE #ifndef QT_NO_SYSTEMLOCALE static QSystemLocale *_systemLocale = 0; -Q_GLOBAL_STATIC_WITH_ARGS(QSystemLocale, QSystemLocale_globalSystemLocale, (true)) +class QSystemLocaleSingleton: public QSystemLocale +{ +public: + QSystemLocaleSingleton() : QSystemLocale(true) {} +}; + +Q_GLOBAL_STATIC(QSystemLocaleSingleton, QSystemLocale_globalSystemLocale) static QLocalePrivate *system_lp = 0; Q_GLOBAL_STATIC(QLocalePrivate, globalLocalePrivate) #endif -- cgit v1.2.3