QmlJsDelta: Guard qDebug output

This commit is contained in:
Kai Koehne
2010-10-07 11:00:14 +02:00
parent e0b11d4374
commit 6863a848e9

View File

@@ -42,6 +42,10 @@ using namespace QmlJS::AST;
namespace {
using namespace QmlJS;
enum {
debug = false
};
/*!
Build a hash of the parents
*/
@@ -475,7 +479,8 @@ Delta::DebugIdMap Delta::operator()(const Document::Ptr &doc1, const Document::P
UiObjectMember* parent = parents2.parent.value(y);
if (!M.way2.contains(parent))
continue;
qDebug () << "Delta::operator(): insert " << label(y, doc2) << " to " << label(parent, doc2);
if (debug)
qDebug () << "Delta::operator(): insert " << label(y, doc2) << " to " << label(parent, doc2);
insert(y, parent, newDebuggIds.value(parent), doc2);
continue;
}
@@ -494,7 +499,8 @@ Delta::DebugIdMap Delta::operator()(const Document::Ptr &doc1, const Document::P
// << " to "<< label(y, doc2) << "with parent " << label(parents2.parent.value(y), doc2);
if (!M.contains(parents1.parent.value(x),parents2.parent.value(y))) {
qDebug () << "Delta::operator(): move " << label(y, doc2) << " from " << label(parents1.parent.value(x), doc1)
if (debug)
qDebug () << "Delta::operator(): move " << label(y, doc2) << " from " << label(parents1.parent.value(x), doc1)
<< " to " << label(parents2.parent.value(y), doc2);
reparent(newDebuggIds.value(y), newDebuggIds.value(parents2.parent.value(y)));
continue;
@@ -508,7 +514,8 @@ Delta::DebugIdMap Delta::operator()(const Document::Ptr &doc1, const Document::P
if (!cast<UiObjectDefinition *>(x))
continue;
if (!M.way1.contains(x)) {
qDebug () << "Delta::operator(): remove " << label(x, doc1);
if (debug)
qDebug () << "Delta::operator(): remove " << label(x, doc1);
QList<DebugId> ids = debugIds.value(x);
if (!ids.isEmpty())
remove(ids);