diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-07-30 01:06:24 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-07-31 01:22:23 (GMT) |
commit | 4238094aad5b3c9b5980bfa6c1ae83e02dc5b9bf (patch) | |
tree | 9f83ee76c4ff5262f53b37c636a33d20f8022c5d /src/corelib | |
parent | 25d7123a0fce87673eb64afe405e310b08f721b9 (diff) | |
download | Qt-4238094aad5b3c9b5980bfa6c1ae83e02dc5b9bf.zip Qt-4238094aad5b3c9b5980bfa6c1ae83e02dc5b9bf.tar.gz Qt-4238094aad5b3c9b5980bfa6c1ae83e02dc5b9bf.tar.bz2 |
removing Q_CORE_EXPORT for q_guard_addGuard() and q_guard_removeGuard()
I made the functions inline instead and moved them to qobject_p.h
Authored-by: Thomas Hartmann
Reviewed-by: Aaron Kennedy
(cherry picked from commit fd27c5ac9670b56ccd60e8d8f6791237358f3633)
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/kernel/kernel.pri | 3 | ||||
-rw-r--r-- | src/corelib/kernel/qguard.cpp | 26 | ||||
-rw-r--r-- | src/corelib/kernel/qguard_p.h | 3 | ||||
-rw-r--r-- | src/corelib/kernel/qobject_p.h | 24 |
4 files changed, 26 insertions, 30 deletions
diff --git a/src/corelib/kernel/kernel.pri b/src/corelib/kernel/kernel.pri index d30f294..3493784 100644 --- a/src/corelib/kernel/kernel.pri +++ b/src/corelib/kernel/kernel.pri @@ -55,8 +55,7 @@ SOURCES += \ kernel/qcoreglobaldata.cpp \ kernel/qsharedmemory.cpp \ kernel/qsystemsemaphore.cpp \ - kernel/qpointer.cpp \ - kernel/qguard.cpp + kernel/qpointer.cpp win32 { SOURCES += \ diff --git a/src/corelib/kernel/qguard.cpp b/src/corelib/kernel/qguard.cpp deleted file mode 100644 index c61be00..0000000 --- a/src/corelib/kernel/qguard.cpp +++ /dev/null @@ -1,26 +0,0 @@ -#include "qguard_p.h" -#include <private/qobject_p.h> - -void q_guard_addGuard(QGuard<QObject> *g) -{ - QObjectPrivate *p = QObjectPrivate::get(g->o); - if (p->wasDeleted) { - qWarning("QGuard: cannot add guard to deleted object"); - g->o = 0; - return; - } - - g->next = p->objectGuards; - p->objectGuards = g; - g->prev = &p->objectGuards; - if (g->next) - g->next->prev = &g->next; -} - -void q_guard_removeGuard(QGuard<QObject> *g) -{ - *g->prev = g->next; - g->next = 0; - g->prev = 0; -} - diff --git a/src/corelib/kernel/qguard_p.h b/src/corelib/kernel/qguard_p.h index 7236ed6..cbc9cca 100644 --- a/src/corelib/kernel/qguard_p.h +++ b/src/corelib/kernel/qguard_p.h @@ -54,6 +54,7 @@ // #include "QtCore/qglobal.h" +#include "private/qobject_p.h" QT_BEGIN_NAMESPACE @@ -92,8 +93,6 @@ protected: virtual void objectDestroyed(T *) {} }; -void Q_CORE_EXPORT q_guard_addGuard(QGuard<QObject> *); -void Q_CORE_EXPORT q_guard_removeGuard(QGuard<QObject> *); template<class T> QGuard<T>::QGuard() diff --git a/src/corelib/kernel/qobject_p.h b/src/corelib/kernel/qobject_p.h index 335768c..7e3e97d 100644 --- a/src/corelib/kernel/qobject_p.h +++ b/src/corelib/kernel/qobject_p.h @@ -182,6 +182,30 @@ public: } }; +inline void q_guard_addGuard(QGuard<QObject> *g) +{ + QObjectPrivate *p = QObjectPrivate::get(g->o); + if (p->wasDeleted) { + qWarning("QGuard: cannot add guard to deleted object"); + g->o = 0; + return; + } + + g->next = p->objectGuards; + p->objectGuards = g; + g->prev = &p->objectGuards; + if (g->next) + g->next->prev = &g->next; +} + +inline void q_guard_removeGuard(QGuard<QObject> *g) +{ + if (g->next) g->next->prev = g->prev; + *g->prev = g->next; + g->next = 0; + g->prev = 0; +} + Q_DECLARE_TYPEINFO(QObjectPrivate::Connection, Q_MOVABLE_TYPE); Q_DECLARE_TYPEINFO(QObjectPrivate::Sender, Q_MOVABLE_TYPE); |