summaryrefslogtreecommitdiffstats
path: root/src/declarative
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2010-04-15 01:56:39 (GMT)
committerMartin Jones <martin.jones@nokia.com>2010-04-15 01:56:39 (GMT)
commit0ddd9958b483e4dbbd5d4b69f3a8425855bdc53b (patch)
tree8ca8fc8ec356da66026d1317f53a4dc570d2b621 /src/declarative
parent9b04182107e35cd1cb924d2e98a9d099b3f8a1c5 (diff)
downloadQt-0ddd9958b483e4dbbd5d4b69f3a8425855bdc53b.zip
Qt-0ddd9958b483e4dbbd5d4b69f3a8425855bdc53b.tar.gz
Qt-0ddd9958b483e4dbbd5d4b69f3a8425855bdc53b.tar.bz2
Output script errors in ScriptAction and StateChangeScript
Task-number: QTBUG-9897
Diffstat (limited to 'src/declarative')
-rw-r--r--src/declarative/util/qdeclarativeanimation.cpp7
-rw-r--r--src/declarative/util/qdeclarativestateoperations.cpp6
2 files changed, 13 insertions, 0 deletions
diff --git a/src/declarative/util/qdeclarativeanimation.cpp b/src/declarative/util/qdeclarativeanimation.cpp
index 33ddb46..fac38d7 100644
--- a/src/declarative/util/qdeclarativeanimation.cpp
+++ b/src/declarative/util/qdeclarativeanimation.cpp
@@ -44,6 +44,7 @@
#include "private/qdeclarativebehavior_p.h"
#include "private/qdeclarativestateoperations_p.h"
+#include "private/qdeclarativecontext_p.h"
#include <qdeclarativepropertyvaluesource.h>
#include <qdeclarative.h>
@@ -767,6 +768,7 @@ void QDeclarativeScriptAction::setStateChangeScriptName(const QString &name)
void QDeclarativeScriptActionPrivate::execute()
{
+ Q_Q(QDeclarativeScriptAction);
if (hasRunScriptScript && reversing)
return;
@@ -775,7 +777,12 @@ void QDeclarativeScriptActionPrivate::execute()
const QString &str = scriptStr.script();
if (!str.isEmpty()) {
QDeclarativeExpression expr(scriptStr.context(), str, scriptStr.scopeObject());
+ QDeclarativeDeclarativeData *ddata = QDeclarativeDeclarativeData::get(q);
+ if (ddata && ddata->outerContext && !ddata->outerContext->url.isEmpty())
+ expr.setSourceLocation(ddata->outerContext->url.toString(), ddata->lineNumber);
expr.value();
+ if (expr.hasError())
+ qWarning() << expr.error();
}
}
diff --git a/src/declarative/util/qdeclarativestateoperations.cpp b/src/declarative/util/qdeclarativestateoperations.cpp
index 410a269..0521d27 100644
--- a/src/declarative/util/qdeclarativestateoperations.cpp
+++ b/src/declarative/util/qdeclarativestateoperations.cpp
@@ -49,6 +49,7 @@
#include <qdeclarativeitem_p.h>
#include <qdeclarativeguard_p.h>
#include <qdeclarativenullablevalue_p_p.h>
+#include "private/qdeclarativecontext_p.h"
#include <QtCore/qdebug.h>
#include <QtGui/qgraphicsitem.h>
@@ -571,7 +572,12 @@ void QDeclarativeStateChangeScript::execute()
const QString &script = d->script.script();
if (!script.isEmpty()) {
QDeclarativeExpression expr(d->script.context(), script, d->script.scopeObject());
+ QDeclarativeDeclarativeData *ddata = QDeclarativeDeclarativeData::get(this);
+ if (ddata && ddata->outerContext && !ddata->outerContext->url.isEmpty())
+ expr.setSourceLocation(ddata->outerContext->url.toString(), ddata->lineNumber);
expr.value();
+ if (expr.hasError())
+ qWarning() << expr.error();
}
}