summaryrefslogtreecommitdiffstats
path: root/src/declarative
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2009-10-12 01:14:04 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2009-10-12 01:14:04 (GMT)
commit4d6958dd6d62441d98826ce141b5824d7eb0dfb0 (patch)
tree4b7edd4c6113fcb475d63ef970e0ab21d3050d71 /src/declarative
parentde4d752b3b1c475e1d5b7bf1539fa6a80a52ba1d (diff)
downloadQt-4d6958dd6d62441d98826ce141b5824d7eb0dfb0.zip
Qt-4d6958dd6d62441d98826ce141b5824d7eb0dfb0.tar.gz
Qt-4d6958dd6d62441d98826ce141b5824d7eb0dfb0.tar.bz2
The root object is always last default object
Fix for QT-2301
Diffstat (limited to 'src/declarative')
-rw-r--r--src/declarative/qml/qmlbasicscript.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/declarative/qml/qmlbasicscript.cpp b/src/declarative/qml/qmlbasicscript.cpp
index f3f9289..f8ef2e7 100644
--- a/src/declarative/qml/qmlbasicscript.cpp
+++ b/src/declarative/qml/qmlbasicscript.cpp
@@ -52,6 +52,8 @@
QT_BEGIN_NAMESPACE
+DEFINE_BOOL_CONFIG_OPTION(qmlBasicScriptDump, QML_BASICSCRIPT_DUMP);
+
using namespace QmlJS;
struct ScriptInstruction {
@@ -400,6 +402,8 @@ bool QmlBasicScript::compile(const Expression &expression)
::memcpy((char *)d->data(), bsc.data.constData(), bsc.data.count());
}
+ if (d && qmlBasicScriptDump())
+ dump();
return d != 0;
}
@@ -649,7 +653,7 @@ QVariant QmlBasicScript::run(QmlContext *context, QObject *me)
case ScriptInstruction::FetchRootConstant:
{
- QObject *obj = contextPrivate->defaultObjects.at(0);
+ QObject *obj = contextPrivate->defaultObjects.last();
stack.push(fetch_value(obj, instr.constant.idx, instr.constant.type));
if (obj && instr.constant.notify != 0)