diff options
author | Jedrzej Nowacki <jedrzej.nowacki@nokia.com> | 2011-03-04 10:29:33 (GMT) |
---|---|---|
committer | Jedrzej Nowacki <jedrzej.nowacki@nokia.com> | 2011-03-07 09:09:49 (GMT) |
commit | abff4d5090c1706c44485bbe3689a0e339c26a9b (patch) | |
tree | 050bbf9d7636bf5a683b8e2bb14f2ce0d3238440 /src/network/bearer | |
parent | 106b19f108644e28d76e6f2a762fa15bd7f0edf5 (diff) | |
download | Qt-abff4d5090c1706c44485bbe3689a0e339c26a9b.zip Qt-abff4d5090c1706c44485bbe3689a0e339c26a9b.tar.gz Qt-abff4d5090c1706c44485bbe3689a0e339c26a9b.tar.bz2 |
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/bearer')
-rw-r--r-- | src/network/bearer/qnetworkconfigmanager.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/network/bearer/qnetworkconfigmanager.cpp b/src/network/bearer/qnetworkconfigmanager.cpp index 2a46229..9e1eaea 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; \ |