summaryrefslogtreecommitdiffstats
path: root/src/network
diff options
context:
space:
mode:
authorJedrzej Nowacki <jedrzej.nowacki@nokia.com>2011-03-04 12:29:33 +0200
committerJedrzej Nowacki <jedrzej.nowacki@nokia.com>2011-03-07 11:09:49 +0200
commitabff4d5090c1706c44485bbe3689a0e339c26a9b (patch)
tree050bbf9d7636bf5a683b8e2bb14f2ce0d3238440 /src/network
parent106b19f108644e28d76e6f2a762fa15bd7f0edf5 (diff)
Improve Q_GLOBAL_STATIC macors.
The patch fix small issues inside the macros. New features: - Class friendly. The macro can be used inside class declaration to define a static method instead of function. - Encapsulation. Smaller default namespace pollution by hiding all this_ variables inside a function. Reviewed-by: Joao
Diffstat (limited to 'src/network')
-rw-r--r--src/network/bearer/qnetworkconfigmanager.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/network/bearer/qnetworkconfigmanager.cpp b/src/network/bearer/qnetworkconfigmanager.cpp
index 2a46229eb3..9e1eaead92 100644
--- a/src/network/bearer/qnetworkconfigmanager.cpp
+++ b/src/network/bearer/qnetworkconfigmanager.cpp
@@ -52,7 +52,8 @@
QT_BEGIN_NAMESPACE
#define Q_GLOBAL_STATIC_QAPP_DESTRUCTION(TYPE, NAME) \
- Q_GLOBAL_STATIC_INIT(TYPE, NAME); \
+ static QGlobalStatic<TYPE > this_##NAME \
+ = { Q_BASIC_ATOMIC_INITIALIZER(0), false }; \
static void NAME##_cleanup() \
{ \
delete this_##NAME.pointer; \