diff options
author | Erik Verbruggen <erik.verbruggen@nokia.com> | 2009-07-27 14:13:03 (GMT) |
---|---|---|
committer | Erik Verbruggen <erik.verbruggen@nokia.com> | 2009-07-27 14:13:03 (GMT) |
commit | 38b6e3bddbb241b101fca8755b6fba338b943302 (patch) | |
tree | 02cdaf9f30a87b9f998b365c04afb616503b6710 | |
parent | ee3c71df7b0a091b078b9b6cbdf60d8f79d95913 (diff) | |
parent | fd27c5ac9670b56ccd60e8d8f6791237358f3633 (diff) | |
download | Qt-38b6e3bddbb241b101fca8755b6fba338b943302.zip Qt-38b6e3bddbb241b101fca8755b6fba338b943302.tar.gz Qt-38b6e3bddbb241b101fca8755b6fba338b943302.tar.bz2 |
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
-rw-r--r-- | src/corelib/kernel/kernel.pri | 1 | ||||
-rw-r--r-- | src/corelib/kernel/qguard.cpp | 27 | ||||
-rw-r--r-- | src/corelib/kernel/qguard_p.h | 3 | ||||
-rw-r--r-- | src/corelib/kernel/qobject_p.h | 24 |
4 files changed, 25 insertions, 30 deletions
diff --git a/src/corelib/kernel/kernel.pri b/src/corelib/kernel/kernel.pri index d71a22a..53b8b69 100644 --- a/src/corelib/kernel/kernel.pri +++ b/src/corelib/kernel/kernel.pri @@ -58,7 +58,6 @@ SOURCES += \ kernel/qsystemsemaphore.cpp \ kernel/qmetaobjectbuilder.cpp \ kernel/qpointer.cpp \ - kernel/qguard.cpp win32 { SOURCES += \ diff --git a/src/corelib/kernel/qguard.cpp b/src/corelib/kernel/qguard.cpp deleted file mode 100644 index ae4f3a5..0000000 --- a/src/corelib/kernel/qguard.cpp +++ /dev/null @@ -1,27 +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) -{ - if (g->next) g->next->prev = g->prev; - *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 4ac0d2d..850082b 100644 --- a/src/corelib/kernel/qobject_p.h +++ b/src/corelib/kernel/qobject_p.h @@ -192,6 +192,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); |