summaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/qmlexpression.cpp
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2009-10-27 04:05:26 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2009-10-27 04:05:26 (GMT)
commit2af9bc37a5955e8e1da2c3ba03fa0be763e2ae5e (patch)
tree778e6e7341a4a6b159a3716e6255179d0a229db0 /src/declarative/qml/qmlexpression.cpp
parent1a862af842db0196313ab7819b607763fd0d87db (diff)
downloadQt-2af9bc37a5955e8e1da2c3ba03fa0be763e2ae5e.zip
Qt-2af9bc37a5955e8e1da2c3ba03fa0be763e2ae5e.tar.gz
Qt-2af9bc37a5955e8e1da2c3ba03fa0be763e2ae5e.tar.bz2
Simplify the defaultObjects handling
As the scope object is no longer added to the defaultObjects list it makes sense that the root object remain constant at position 0
Diffstat (limited to 'src/declarative/qml/qmlexpression.cpp')
-rw-r--r--src/declarative/qml/qmlexpression.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/declarative/qml/qmlexpression.cpp b/src/declarative/qml/qmlexpression.cpp
index 3b89a23..c62756b 100644
--- a/src/declarative/qml/qmlexpression.cpp
+++ b/src/declarative/qml/qmlexpression.cpp
@@ -293,8 +293,7 @@ QVariant QmlExpressionPrivate::evalQtScript(QObject *secondaryScope, bool *isUnd
QmlEnginePrivate *ep = QmlEnginePrivate::get(engine);
if (secondaryScope)
- ctxtPriv->defaultObjects.insert(ctxtPriv->highPriorityCount,
- secondaryScope);
+ ctxtPriv->defaultObjects.append(secondaryScope);
QScriptEngine *scriptEngine = QmlEnginePrivate::getScriptEngine(engine);
@@ -328,8 +327,11 @@ QVariant QmlExpressionPrivate::evalQtScript(QObject *secondaryScope, bool *isUnd
return QVariant();
}
- if (secondaryScope)
- ctxtPriv->defaultObjects.removeAt(ctxtPriv->highPriorityCount);
+ if (secondaryScope) {
+ QObject *last = ctxtPriv->defaultObjects.takeLast();
+ Q_ASSERT(last == secondaryScope);
+ Q_UNUSED(last);
+ }
QVariant rv;