diff options
author | Martin Jones <martin.jones@nokia.com> | 2009-12-04 01:57:05 (GMT) |
---|---|---|
committer | Martin Jones <martin.jones@nokia.com> | 2009-12-04 01:57:05 (GMT) |
commit | c37cdb5a8e8eea672fa59a3cb427b74d6a928a30 (patch) | |
tree | 89dde1623a991a24a9287de1e6ed4ea3bece103e /src/declarative/qml/qmlexpression.cpp | |
parent | 261c8600253ad17f41c3b4830b9086a8a034fa4a (diff) | |
parent | b664d980f4c3b6fb379d68e54b6087b83a4c26b0 (diff) | |
download | Qt-c37cdb5a8e8eea672fa59a3cb427b74d6a928a30.zip Qt-c37cdb5a8e8eea672fa59a3cb427b74d6a928a30.tar.gz Qt-c37cdb5a8e8eea672fa59a3cb427b74d6a928a30.tar.bz2 |
Merge branch 'kinetic-declarativeui' of scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Diffstat (limited to 'src/declarative/qml/qmlexpression.cpp')
-rw-r--r-- | src/declarative/qml/qmlexpression.cpp | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/src/declarative/qml/qmlexpression.cpp b/src/declarative/qml/qmlexpression.cpp index 2239d77..ab9f9ea 100644 --- a/src/declarative/qml/qmlexpression.cpp +++ b/src/declarative/qml/qmlexpression.cpp @@ -41,12 +41,15 @@ #include "qmlexpression.h" #include "qmlexpression_p.h" + #include "qmlengine_p.h" #include "qmlcontext_p.h" #include "qmlrewrite_p.h" -#include "QtCore/qdebug.h" #include "qmlcompiler_p.h" + +#include <QtCore/qdebug.h> #include <QtScript/qscriptprogram.h> + #include <private/qscriptdeclarativeclass_p.h> Q_DECLARE_METATYPE(QList<QObject *>); @@ -91,7 +94,7 @@ void QmlExpressionPrivate::init(QmlContext *ctxt, const QString &expr, } void QmlExpressionPrivate::init(QmlContext *ctxt, void *expr, QmlRefCount *rc, - QObject *me, const QUrl &url, int lineNumber) + QObject *me, const QString &url, int lineNumber) { data->url = url; data->line = lineNumber; @@ -120,7 +123,7 @@ void QmlExpressionPrivate::init(QmlContext *ctxt, void *expr, QmlRefCount *rc, if (!dd->cachedClosures.at(progIdx)) { QScriptContext *scriptContext = QScriptDeclarativeClass::pushCleanContext(scriptEngine); scriptContext->pushScope(ep->contextClass->newSharedContext()); - dd->cachedClosures[progIdx] = new QScriptValue(scriptEngine->evaluate(data->expression, data->url.toString(), data->line)); + dd->cachedClosures[progIdx] = new QScriptValue(scriptEngine->evaluate(data->expression, data->url, data->line)); scriptEngine->popContext(); } @@ -133,7 +136,7 @@ void QmlExpressionPrivate::init(QmlContext *ctxt, void *expr, QmlRefCount *rc, #if !defined(Q_OS_SYMBIAN) //XXX Why doesn't this work? if (!dd->cachedPrograms.at(progIdx)) { dd->cachedPrograms[progIdx] = - new QScriptProgram(data->expression, data->url.toString(), data->line); + new QScriptProgram(data->expression, data->url, data->line); } #endif @@ -174,7 +177,7 @@ QmlExpression::QmlExpression() /*! \internal */ QmlExpression::QmlExpression(QmlContext *ctxt, void *expr, QmlRefCount *rc, QObject *me, - const QUrl &url, int lineNumber, + const QString &url, int lineNumber, QmlExpressionPrivate &dd) : QObject(dd, 0) { @@ -331,7 +334,7 @@ QVariant QmlExpressionPrivate::evalQtScript(QObject *secondaryScope, bool *isUnd if (data->expressionRewritten) { data->expressionFunction = scriptEngine->evaluate(data->expression, - data->url.toString(), data->line); + data->url, data->line); } else { QmlRewrite::RewriteBinding rewriteBinding; @@ -341,7 +344,7 @@ QVariant QmlExpressionPrivate::evalQtScript(QObject *secondaryScope, bool *isUnd scriptEngine->popContext(); return QVariant(); } - data->expressionFunction = scriptEngine->evaluate(code, data->url.toString(), data->line); + data->expressionFunction = scriptEngine->evaluate(code, data->url, data->line); } scriptEngine->popContext(); @@ -521,7 +524,7 @@ void QmlExpression::setTrackChange(bool trackChange) Returns the source file URL for this expression. The source location must have been previously set by calling setSourceLocation(). */ -QUrl QmlExpression::sourceFile() const +QString QmlExpression::sourceFile() const { Q_D(const QmlExpression); return d->data->url; @@ -541,7 +544,7 @@ int QmlExpression::lineNumber() const Set the location of this expression to \a line of \a url. This information is used by the script engine. */ -void QmlExpression::setSourceLocation(const QUrl &url, int line) +void QmlExpression::setSourceLocation(const QString &url, int line) { Q_D(QmlExpression); d->data->url = url; |