Commit 7dadea26 authored by Erik Verbruggen's avatar Erik Verbruggen
Browse files

Changed a define into an enum.

parent e87cd6d1
...@@ -42,7 +42,12 @@ ...@@ -42,7 +42,12 @@
#include <QDebug> #include <QDebug>
#define INDENT_DEPTH 4 #define INDENT_DEPTH 4
#undef DUMP_REWRITE_ACTIONS
namespace {
enum {
DebugRewriteActions = 0
};
}
using namespace QmlJS; using namespace QmlJS;
using namespace QmlDesigner; using namespace QmlDesigner;
...@@ -225,13 +230,14 @@ void ModelToTextMerger::applyChanges() ...@@ -225,13 +230,14 @@ void ModelToTextMerger::applyChanges()
} }
RewriteAction* action = m_rewriteActions.at(i); RewriteAction* action = m_rewriteActions.at(i);
#ifdef DUMP_REWRITE_ACTIONS if (DebugRewriteActions) {
qDebug() << "Next rewrite action:" << qPrintable(action->info()); qDebug() << "Next rewrite action:" << qPrintable(action->info());
#endif // DUMP_REWRITE_ACTIONS }
ModelNodePositionStorage *positionStore = m_rewriterView->positionStorage(); ModelNodePositionStorage *positionStore = m_rewriterView->positionStorage();
const bool success = action->execute(refactoring, *positionStore); const bool success = action->execute(refactoring, *positionStore);
if (!success) { if (!success /*&& DebugRewriteActions*/) {
qDebug() << "*** QML source code: ***"; qDebug() << "*** QML source code: ***";
qDebug() << qPrintable(textModifier->text()); qDebug() << qPrintable(textModifier->text());
qDebug() << "*** End of QML source code. ***"; qDebug() << "*** End of QML source code. ***";
...@@ -318,15 +324,13 @@ bool ModelToTextMerger::isInHierarchy(const AbstractProperty &property) { ...@@ -318,15 +324,13 @@ bool ModelToTextMerger::isInHierarchy(const AbstractProperty &property) {
void ModelToTextMerger::dumpRewriteActions(const QString &msg) void ModelToTextMerger::dumpRewriteActions(const QString &msg)
{ {
#ifdef DUMP_REWRITE_ACTIONS if (DebugRewriteActions) {
qDebug() << "---->" << qPrintable(msg); qDebug() << "---->" << qPrintable(msg);
foreach (RewriteAction *action, m_rewriteActions) { foreach (RewriteAction *action, m_rewriteActions) {
qDebug() << "-----" << qPrintable(action->info()); qDebug() << "-----" << qPrintable(action->info());
} }
qDebug() << "<----" << qPrintable(msg); qDebug() << "<----" << qPrintable(msg);
#else // DUMP_REWRITE_ACTIONS }
Q_UNUSED(msg);
#endif // DUMP_REWRITE_ACTIONS
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment