From ca92c8e4bf6d9bcd843d020c974c6e2ed515cf15 Mon Sep 17 00:00:00 2001 From: Denis Dzyubenko Date: Thu, 22 Jul 2010 16:29:09 +0200 Subject: 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 --- src/imports/gestures/qdeclarativegesturearea.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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? } } -- cgit v0.12