diff options
Diffstat (limited to 'src/declarative/qml/qmlexpression.cpp')
-rw-r--r-- | src/declarative/qml/qmlexpression.cpp | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/src/declarative/qml/qmlexpression.cpp b/src/declarative/qml/qmlexpression.cpp index 148ff71..3206734 100644 --- a/src/declarative/qml/qmlexpression.cpp +++ b/src/declarative/qml/qmlexpression.cpp @@ -51,7 +51,7 @@ Q_DECLARE_METATYPE(QList<QObject *>); QT_BEGIN_NAMESPACE QmlExpressionPrivate::QmlExpressionPrivate() -: ctxt(0), expressionFunctionValid(false), expressionRewritten(false), sseData(0), me(0), trackChange(true), line(-1), guardList(0), guardListLength(0) +: nextExpression(0), prevExpression(0), ctxt(0), expressionFunctionValid(false), expressionRewritten(false), sseData(0), me(0), trackChange(true), line(-1), guardList(0), guardListLength(0) { } @@ -63,8 +63,12 @@ void QmlExpressionPrivate::init(QmlContext *ctxt, const QString &expr, expression = expr; this->ctxt = ctxt; - if (ctxt) - ctxt->d_func()->childExpressions.insert(q); + if (ctxt) { + QmlContextPrivate *cp = ctxt->d_func(); + nextExpression = cp->expressions; + prevExpression = &cp->expressions; + cp->expressions = this; + } this->me = me; } @@ -84,8 +88,12 @@ void QmlExpressionPrivate::init(QmlContext *ctxt, void *expr, QmlRefCount *rc, } this->ctxt = ctxt; - if (ctxt) - ctxt->d_func()->childExpressions.insert(q); + if (ctxt) { + QmlContextPrivate *cp = ctxt->d_func(); + nextExpression = cp->expressions; + prevExpression = &cp->expressions; + cp->expressions = this; + } this->me = me; } @@ -152,8 +160,11 @@ QmlExpression::QmlExpression(QmlContext *ctxt, const QString &expression, QmlExpression::~QmlExpression() { Q_D(QmlExpression); - if (d->ctxt) - d->ctxt->d_func()->childExpressions.remove(this); + if (d->prevExpression) { + *(d->prevExpression) = d->nextExpression; + if (d->nextExpression) + d->nextExpression->prevExpression = d->prevExpression; + } } /*! |