From 6863a848e991a839e2b09ac0a9006c04ce9598a3 Mon Sep 17 00:00:00 2001 From: Kai Koehne <kai.koehne@nokia.com> Date: Thu, 7 Oct 2010 11:00:14 +0200 Subject: [PATCH] QmlJsDelta: Guard qDebug output --- src/libs/qmljs/qmljsdelta.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/libs/qmljs/qmljsdelta.cpp b/src/libs/qmljs/qmljsdelta.cpp index da0022a419d..6c71e3c5e7a 100644 --- a/src/libs/qmljs/qmljsdelta.cpp +++ b/src/libs/qmljs/qmljsdelta.cpp @@ -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); -- GitLab