diff options
author | Martin Jones <martin.jones@nokia.com> | 2009-10-12 06:56:50 (GMT) |
---|---|---|
committer | Martin Jones <martin.jones@nokia.com> | 2009-10-12 06:56:50 (GMT) |
commit | 7421702dd3202c21f3871171792476f0d2d50abe (patch) | |
tree | 5a45e20fd74e23cf0a4ad2aa1a80bd073fa51413 /src/declarative/qml/qmlbasicscript.cpp | |
parent | 9094a6588de3a7264ec4647a24b94253a7609823 (diff) | |
parent | 949e21cdafeec0c0e4ac632ebbf21767479f04e5 (diff) | |
download | Qt-7421702dd3202c21f3871171792476f0d2d50abe.zip Qt-7421702dd3202c21f3871171792476f0d2d50abe.tar.gz Qt-7421702dd3202c21f3871171792476f0d2d50abe.tar.bz2 |
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Conflicts:
src/declarative/qml/qmlcompiler.cpp
Diffstat (limited to 'src/declarative/qml/qmlbasicscript.cpp')
-rw-r--r-- | src/declarative/qml/qmlbasicscript.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/declarative/qml/qmlbasicscript.cpp b/src/declarative/qml/qmlbasicscript.cpp index f3f9289..a0d749f 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 { @@ -367,7 +369,7 @@ bool QmlBasicScript::compile(const Expression &expression) { if (!expression.expression.asAST()) return false; - QByteArray expr = expression.expression.asScript().toLatin1(); + QByteArray expr = expression.expression.asScript().toUtf8(); const char *src = expr.constData(); QmlBasicScriptCompiler bsc; @@ -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) |