summaryrefslogtreecommitdiffstats
path: root/src/declarative
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2009-07-15 08:21:56 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2009-07-15 08:21:56 (GMT)
commit9b427652044114a1a77f7c1a32526d570f2bb3e8 (patch)
tree8d93626246c3a3f9a096ad8820031ce5ea3ee08f /src/declarative
parentc1f79fb0b4b778a2f41204aa62711060a3b021fc (diff)
downloadQt-9b427652044114a1a77f7c1a32526d570f2bb3e8.zip
Qt-9b427652044114a1a77f7c1a32526d570f2bb3e8.tar.gz
Qt-9b427652044114a1a77f7c1a32526d570f2bb3e8.tar.bz2
Revert "Use a function object when evaluating bindings"
Turns out this simple approach doesn't work. Fortunately we have a volunteer to do it properly. This reverts commit 958dc50e2b0fe2e875a704554438be75907ed3c5.
Diffstat (limited to 'src/declarative')
-rw-r--r--src/declarative/qml/qmlexpression.cpp18
-rw-r--r--src/declarative/qml/qmlexpression_p.h4
2 files changed, 5 insertions, 17 deletions
diff --git a/src/declarative/qml/qmlexpression.cpp b/src/declarative/qml/qmlexpression.cpp
index 3d8ee37..84352b8 100644
--- a/src/declarative/qml/qmlexpression.cpp
+++ b/src/declarative/qml/qmlexpression.cpp
@@ -52,17 +52,17 @@ QT_BEGIN_NAMESPACE
DEFINE_BOOL_CONFIG_OPTION(qmlDebugger, QML_DEBUGGER)
QmlExpressionPrivate::QmlExpressionPrivate(QmlExpression *b)
-: q(b), ctxt(0), expressionFunctionValid(false), sseData(0), proxy(0), me(0), trackChange(false), line(-1), id(0), log(0)
+: q(b), ctxt(0), sseData(0), proxy(0), me(0), trackChange(false), line(-1), id(0), log(0)
{
}
QmlExpressionPrivate::QmlExpressionPrivate(QmlExpression *b, void *expr, QmlRefCount *rc)
-: q(b), ctxt(0), expressionFunctionValid(false), sse((const char *)expr, rc), sseData(0), proxy(0), me(0), trackChange(true), line(-1), id(0), log(0)
+: q(b), ctxt(0), sse((const char *)expr, rc), sseData(0), proxy(0), me(0), trackChange(true), line(-1), id(0), log(0)
{
}
QmlExpressionPrivate::QmlExpressionPrivate(QmlExpression *b, const QString &expr)
-: q(b), ctxt(0), expression(expr), expressionFunctionValid(false), sseData(0), proxy(0), me(0), trackChange(true), line(-1), id(0), log(0)
+: q(b), ctxt(0), expression(expr), sseData(0), proxy(0), me(0), trackChange(true), line(-1), id(0), log(0)
{
}
@@ -177,8 +177,6 @@ void QmlExpression::setExpression(const QString &expression)
delete d->proxy; d->proxy = 0;
d->expression = expression;
- d->expressionFunctionValid = false;
- d->expressionFunction = QScriptValue();
d->sse.clear();
}
@@ -236,14 +234,8 @@ QVariant QmlExpressionPrivate::evalQtScript()
for (int i = ctxtPriv->scopeChain.size() - 1; i > -1; --i)
scriptEngine->currentContext()->pushScope(ctxtPriv->scopeChain.at(i));
- if (!expressionFunctionValid) {
- expressionFunction =
- scriptEngine->evaluate("function() {" +expression+"}",
- fileName.toString(), line);
- expressionFunctionValid = true;
- }
-
- QScriptValue svalue = expressionFunction.call();
+ QScriptValue svalue =
+ scriptEngine->evaluate(expression, fileName.toString(), line);
if (scriptEngine->hasUncaughtException()) {
if (scriptEngine->uncaughtException().isError()){
diff --git a/src/declarative/qml/qmlexpression_p.h b/src/declarative/qml/qmlexpression_p.h
index 09745a3..5883125 100644
--- a/src/declarative/qml/qmlexpression_p.h
+++ b/src/declarative/qml/qmlexpression_p.h
@@ -55,7 +55,6 @@
#include "qmlbasicscript_p.h"
#include "qmlexpression.h"
-#include <QtScript/qscriptvalue.h>
QT_BEGIN_NAMESPACE
@@ -74,9 +73,6 @@ public:
QmlExpression *q;
QmlContext *ctxt;
QString expression;
- bool expressionFunctionValid;
- QScriptValue expressionFunction;
-
QmlBasicScript sse;
void *sseData;
QmlExpressionBindProxy *proxy;