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 <lars.knoll@nokia.com>bb10
parent
6cdbfc6f94
commit
8df589bebc
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -122,7 +122,7 @@ public:
|
|||
|
||||
private:
|
||||
QSystemLocale(bool);
|
||||
friend QSystemLocale *QSystemLocale_globalSystemLocale();
|
||||
friend class QSystemLocaleSingleton;
|
||||
};
|
||||
#endif
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue