summaryrefslogtreecommitdiffstats
path: root/src/declarative/qml
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2009-10-14 04:49:45 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2009-10-14 04:49:45 (GMT)
commit339c91215f0bae4af44fe3124f41244541607a2b (patch)
tree51fa5a306434b8e205cb935320b24d04867f8bca /src/declarative/qml
parentfd9312e358a9ee24f8a83a6d4c78c7816ab3c95c (diff)
downloadQt-339c91215f0bae4af44fe3124f41244541607a2b.zip
Qt-339c91215f0bae4af44fe3124f41244541607a2b.tar.gz
Qt-339c91215f0bae4af44fe3124f41244541607a2b.tar.bz2
Add QML_REWRITE_DUMP env flag
Diffstat (limited to 'src/declarative/qml')
-rw-r--r--src/declarative/qml/qmlrewrite.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/declarative/qml/qmlrewrite.cpp b/src/declarative/qml/qmlrewrite.cpp
index 5166c96..a41b571 100644
--- a/src/declarative/qml/qmlrewrite.cpp
+++ b/src/declarative/qml/qmlrewrite.cpp
@@ -40,9 +40,13 @@
****************************************************************************/
#include "qmlrewrite_p.h"
+#include <QtDeclarative/qfxglobal.h>
+#include <QtCore/qdebug.h>
QT_BEGIN_NAMESPACE
+DEFINE_BOOL_CONFIG_OPTION(rewriteDump, QML_REWRITE_DUMP);
+
namespace QmlRewrite {
QString RewriteBinding::operator()(const QString &code)
@@ -76,8 +80,20 @@ QString RewriteBinding::rewrite(QString code, unsigned position,
_writer->replace(startOfStatement, 0, QLatin1String("(function() { "));
_writer->replace(endOfStatement, 0, QLatin1String(" })"));
+ if (rewriteDump()) {
+ qWarning() << "=============================================================";
+ qWarning() << "Rewrote:";
+ qWarning() << qPrintable(code);
+ }
+
w.write(&code);
+ if (rewriteDump()) {
+ qWarning() << "To:";
+ qWarning() << qPrintable(code);
+ qWarning() << "=============================================================";
+ }
+
return code;
}