summaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/qmlcontext_p.h
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2010-01-27 03:32:24 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2010-01-27 05:18:17 (GMT)
commit01a946c6b3838a1c094687785be041b156ac1410 (patch)
treeb22473b4a696d74249884e3ae5351afde57e4969 /src/declarative/qml/qmlcontext_p.h
parent6f1d4e8bdd9a11a4d35c8386e0c7e236bcfebd95 (diff)
downloadQt-01a946c6b3838a1c094687785be041b156ac1410.zip
Qt-01a946c6b3838a1c094687785be041b156ac1410.tar.gz
Qt-01a946c6b3838a1c094687785be041b156ac1410.tar.bz2
Cleanup
Diffstat (limited to 'src/declarative/qml/qmlcontext_p.h')
-rw-r--r--src/declarative/qml/qmlcontext_p.h62
1 files changed, 53 insertions, 9 deletions
diff --git a/src/declarative/qml/qmlcontext_p.h b/src/declarative/qml/qmlcontext_p.h
index ffb4298..cd7e1b6 100644
--- a/src/declarative/qml/qmlcontext_p.h
+++ b/src/declarative/qml/qmlcontext_p.h
@@ -59,7 +59,6 @@
#include "qmlengine_p.h"
#include "qmlintegercache_p.h"
#include "qmltypenamecache_p.h"
-#include "qmlbindingvme_p.h"
#include <QtCore/qhash.h>
#include <QtScript/qscriptvalue.h>
@@ -77,7 +76,7 @@ class QmlExpression;
class QmlExpressionPrivate;
class QmlAbstractExpression;
class QmlBinding_Id;
-class QmlOptimizedBindings;
+class QmlCompiledBindings;
class Q_DECLARATIVE_EXPORT QmlContextPrivate : public QObjectPrivate
{
@@ -114,15 +113,27 @@ public:
QmlDeclarativeData *contextObjects;
+ struct IdNotifier
+ {
+ inline IdNotifier();
+ inline ~IdNotifier();
+
+ inline void clear();
+
+ IdNotifier *next;
+ IdNotifier**prev;
+ QObject *target;
+ int methodIndex;
+ };
+
struct ContextGuard : public QmlGuard<QObject>
{
- ContextGuard() : priv(0), bindings(0) {}
+ inline ContextGuard();
+ inline ContextGuard &operator=(QObject *obj);
+ inline virtual void objectDestroyed(QObject *);
+
QmlContextPrivate *priv;
- QmlBindingVME::Config::Subscription::Id *bindings;
- ContextGuard &operator=(QObject *obj) {
- (QmlGuard<QObject>&)*this = obj; return *this;
- }
- void objectDestroyed(QObject *) { priv->destroyed(this); }
+ IdNotifier *bindings;
};
ContextGuard *idValues;
int idValueCount;
@@ -137,12 +148,45 @@ public:
return static_cast<QmlContext *>(context->q_func());
}
- QmlOptimizedBindings *optimizedBindings;
+ QmlCompiledBindings *optimizedBindings;
// Only used for debugging
QList<QPointer<QObject> > instances;
};
+QmlContextPrivate::IdNotifier::IdNotifier()
+: next(0), prev(0), target(0), methodIndex(-1)
+{
+}
+
+QmlContextPrivate::IdNotifier::~IdNotifier()
+{
+ clear();
+}
+
+void QmlContextPrivate::IdNotifier::clear()
+{
+ if (next) next->prev = prev;
+ if (prev) *prev = next;
+ next = 0; prev = 0; target = 0;
+ methodIndex = -1;
+}
+
+QmlContextPrivate::ContextGuard::ContextGuard()
+: priv(0), bindings(0)
+{
+}
+
+QmlContextPrivate::ContextGuard &QmlContextPrivate::ContextGuard::operator=(QObject *obj)
+{
+ (QmlGuard<QObject>&)*this = obj; return *this;
+}
+
+void QmlContextPrivate::ContextGuard::objectDestroyed(QObject *)
+{
+ priv->destroyed(this);
+}
+
QT_END_NAMESPACE
#endif // QMLCONTEXT_P_H