summaryrefslogtreecommitdiffstats
path: root/src/imports/gestures/qdeclarativegesturearea.cpp
diff options
context:
space:
mode:
authorDenis Dzyubenko <denis.dzyubenko@nokia.com>2010-07-22 14:29:09 (GMT)
committerDenis Dzyubenko <denis.dzyubenko@nokia.com>2010-07-23 09:46:39 (GMT)
commitca92c8e4bf6d9bcd843d020c974c6e2ed515cf15 (patch)
treef05ecdd9988da5de7a617448b12e87af99ca8d87 /src/imports/gestures/qdeclarativegesturearea.cpp
parent1e42dc7e2421969a5a941d15d425eaf4d8bf3f7d (diff)
downloadQt-ca92c8e4bf6d9bcd843d020c974c6e2ed515cf15.zip
Qt-ca92c8e4bf6d9bcd843d020c974c6e2ed515cf15.tar.gz
Qt-ca92c8e4bf6d9bcd843d020c974c6e2ed515cf15.tar.bz2
Report errors when evaluating JavaScript expressions from the GestureArea QML plugin.
Before the patch if the evaluation fails (for any reason - because you access invalid or non-existing property, or because of a spelling mistake, etc), the expression will be silently ignored, making if very hard to figure out what is going wrong. The patch makes sure the error description will be printed on the output. Reviewed-by: Warwick Allison
Diffstat (limited to 'src/imports/gestures/qdeclarativegesturearea.cpp')
-rw-r--r--src/imports/gestures/qdeclarativegesturearea.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/imports/gestures/qdeclarativegesturearea.cpp b/src/imports/gestures/qdeclarativegesturearea.cpp
index 243ba0f..a8f98f1 100644
--- a/src/imports/gestures/qdeclarativegesturearea.cpp
+++ b/src/imports/gestures/qdeclarativegesturearea.cpp
@@ -261,7 +261,10 @@ bool QDeclarativeGestureAreaPrivate::gestureEvent(QGestureEvent *event)
bool accept = true;
for (Bindings::Iterator it = bindings.begin(); it != bindings.end(); ++it) {
if ((gesture = event->gesture(it.key()))) {
- it.value()->evaluate();
+ QDeclarativeExpression *expr = it.value();
+ expr->evaluate();
+ if (expr->hasError())
+ qmlInfo(q_func()) << expr->error();
event->setAccepted(true); // XXX only if value returns true?
}
}