Remove debugging output.

This commit is contained in:
dt
2010-03-12 15:12:46 +01:00
parent 97d501de42
commit b5f8d7af7f

View File

@@ -620,19 +620,23 @@ QStringList Qt4Project::frameworkPaths(const QString &fileName) const
// */ // */
void Qt4Project::update() void Qt4Project::update()
{ {
qDebug()<<"Doing sync update"; if (debug)
qDebug()<<"Doing sync update";
m_rootProjectNode->update(); m_rootProjectNode->update();
qDebug()<<"State is now Base"; if (debug)
qDebug()<<"State is now Base";
m_asyncUpdateState = Base; m_asyncUpdateState = Base;
} }
void Qt4Project::scheduleAsyncUpdate(Qt4ProFileNode *node) void Qt4Project::scheduleAsyncUpdate(Qt4ProFileNode *node)
{ {
qDebug()<<"schduleAsyncUpdate (node)"; if (debug)
qDebug()<<"schduleAsyncUpdate (node)";
Q_ASSERT(m_asyncUpdateState != NoState); Q_ASSERT(m_asyncUpdateState != NoState);
if (m_cancelEvaluate) { if (m_cancelEvaluate) {
qDebug()<<" Already canceling, nothing to do"; if (debug)
qDebug()<<" Already canceling, nothing to do";
// A cancel is in progress // A cancel is in progress
// That implies that a full update is going to happen afterwards // That implies that a full update is going to happen afterwards
// So we don't need to do anything // So we don't need to do anything
@@ -641,17 +645,20 @@ void Qt4Project::scheduleAsyncUpdate(Qt4ProFileNode *node)
if (m_asyncUpdateState == AsyncFullUpdatePending) { if (m_asyncUpdateState == AsyncFullUpdatePending) {
// Just postpone // Just postpone
qDebug()<<" full update pending, restarting timer"; if (debug)
qDebug()<<" full update pending, restarting timer";
m_asyncUpdateTimer.start(); m_asyncUpdateTimer.start();
} else if (m_asyncUpdateState == AsyncPartialUpdatePending } else if (m_asyncUpdateState == AsyncPartialUpdatePending
|| m_asyncUpdateState == Base) { || m_asyncUpdateState == Base) {
qDebug()<<" adding node to async update list, setting state to AsyncPartialUpdatePending"; if (debug)
qDebug()<<" adding node to async update list, setting state to AsyncPartialUpdatePending";
// Add the node // Add the node
m_asyncUpdateState = AsyncPartialUpdatePending; m_asyncUpdateState = AsyncPartialUpdatePending;
QList<Internal::Qt4ProFileNode *>::iterator it; QList<Internal::Qt4ProFileNode *>::iterator it;
bool add = true; bool add = true;
qDebug()<<"scheduleAsyncUpdate();"<<m_partialEvaluate.size()<<"nodes"; if (debug)
qDebug()<<"scheduleAsyncUpdate();"<<m_partialEvaluate.size()<<"nodes";
it = m_partialEvaluate.begin(); it = m_partialEvaluate.begin();
while (it != m_partialEvaluate.end()) { while (it != m_partialEvaluate.end()) {
if (*it == node) { if (*it == node) {
@@ -679,28 +686,33 @@ void Qt4Project::scheduleAsyncUpdate(Qt4ProFileNode *node)
// change a partial update gets in progress and then another // change a partial update gets in progress and then another
// batch of changes come in, which triggers a full update // batch of changes come in, which triggers a full update
// even if that's not really needed // even if that's not really needed
qDebug()<<" Async update in progress, scheduling new one afterwards"; if (debug)
qDebug()<<" Async update in progress, scheduling new one afterwards";
scheduleAsyncUpdate(); scheduleAsyncUpdate();
} }
} }
void Qt4Project::scheduleAsyncUpdate() void Qt4Project::scheduleAsyncUpdate()
{ {
qDebug()<<"scheduleAsyncUpdate"; if (debug)
qDebug()<<"scheduleAsyncUpdate";
Q_ASSERT(m_asyncUpdateState != NoState); Q_ASSERT(m_asyncUpdateState != NoState);
if (m_cancelEvaluate) { // we are in progress of canceling if (m_cancelEvaluate) { // we are in progress of canceling
// and will start the evaluation after that // and will start the evaluation after that
qDebug()<<" canceling is in progress, doing nothing"; if (debug)
qDebug()<<" canceling is in progress, doing nothing";
return; return;
} }
if (m_asyncUpdateState == AsyncUpdateInProgress) { if (m_asyncUpdateState == AsyncUpdateInProgress) {
qDebug()<<" update in progress, canceling and setting state to full update pending"; if (debug)
qDebug()<<" update in progress, canceling and setting state to full update pending";
m_cancelEvaluate = true; m_cancelEvaluate = true;
m_asyncUpdateState = AsyncFullUpdatePending; m_asyncUpdateState = AsyncFullUpdatePending;
return; return;
} }
qDebug()<<" starting timer for full update, setting state to full update pending"; if (debug)
qDebug()<<" starting timer for full update, setting state to full update pending";
m_partialEvaluate.clear(); m_partialEvaluate.clear();
m_asyncUpdateState = AsyncFullUpdatePending; m_asyncUpdateState = AsyncFullUpdatePending;
m_asyncUpdateTimer.start(); m_asyncUpdateTimer.start();
@@ -710,7 +722,8 @@ void Qt4Project::scheduleAsyncUpdate()
void Qt4Project::incrementPendingEvaluateFutures() void Qt4Project::incrementPendingEvaluateFutures()
{ {
++m_pendingEvaluateFuturesCount; ++m_pendingEvaluateFuturesCount;
qDebug()<<"incrementPendingEvaluateFutures to"<<m_pendingEvaluateFuturesCount; if (debug)
qDebug()<<"incrementPendingEvaluateFutures to"<<m_pendingEvaluateFuturesCount;
m_asyncUpdateFutureInterface->setProgressRange(m_asyncUpdateFutureInterface->progressMinimum(), m_asyncUpdateFutureInterface->setProgressRange(m_asyncUpdateFutureInterface->progressMinimum(),
m_asyncUpdateFutureInterface->progressMaximum() + 1); m_asyncUpdateFutureInterface->progressMaximum() + 1);
@@ -720,13 +733,16 @@ void Qt4Project::decrementPendingEvaluateFutures()
{ {
--m_pendingEvaluateFuturesCount; --m_pendingEvaluateFuturesCount;
qDebug()<<"decrementPendingEvaluateFutures to"<<m_pendingEvaluateFuturesCount; if (debug)
qDebug()<<"decrementPendingEvaluateFutures to"<<m_pendingEvaluateFuturesCount;
m_asyncUpdateFutureInterface->setProgressValue(m_asyncUpdateFutureInterface->progressValue() + 1); m_asyncUpdateFutureInterface->setProgressValue(m_asyncUpdateFutureInterface->progressValue() + 1);
if (m_pendingEvaluateFuturesCount == 0) { if (m_pendingEvaluateFuturesCount == 0) {
qDebug()<<" WOHOO, no pending futures, cleaning up"; if (debug)
qDebug()<<" WOHOO, no pending futures, cleaning up";
// We are done! // We are done!
qDebug()<<" reporting finished"; if (debug)
qDebug()<<" reporting finished";
m_asyncUpdateFutureInterface->reportFinished(); m_asyncUpdateFutureInterface->reportFinished();
delete m_asyncUpdateFutureInterface; delete m_asyncUpdateFutureInterface;
m_asyncUpdateFutureInterface = 0; m_asyncUpdateFutureInterface = 0;
@@ -734,7 +750,8 @@ void Qt4Project::decrementPendingEvaluateFutures()
// TODO clear the profile cache ? // TODO clear the profile cache ?
if (m_asyncUpdateState == AsyncFullUpdatePending || m_asyncUpdateState == AsyncPartialUpdatePending) { if (m_asyncUpdateState == AsyncFullUpdatePending || m_asyncUpdateState == AsyncPartialUpdatePending) {
qDebug()<<" Oh update is pending start the timer"; if (debug)
qDebug()<<" Oh update is pending start the timer";
m_asyncUpdateTimer.start(); m_asyncUpdateTimer.start();
} else if (m_asyncUpdateState != ShuttingDown){ } else if (m_asyncUpdateState != ShuttingDown){
// After beeing done, we need to call: // After beeing done, we need to call:
@@ -742,7 +759,8 @@ void Qt4Project::decrementPendingEvaluateFutures()
updateCodeModel(); updateCodeModel();
checkForNewApplicationProjects(); checkForNewApplicationProjects();
checkForDeletedApplicationProjects(); checkForDeletedApplicationProjects();
qDebug()<<" Setting state to Base"; if (debug)
qDebug()<<" Setting state to Base";
m_asyncUpdateState = Base; m_asyncUpdateState = Base;
} }
} }
@@ -755,29 +773,34 @@ bool Qt4Project::wasEvaluateCanceled()
void Qt4Project::asyncUpdate() void Qt4Project::asyncUpdate()
{ {
qDebug()<<"async update, timer expired, doing now"; if (debug)
qDebug()<<"async update, timer expired, doing now";
Q_ASSERT(!m_asyncUpdateFutureInterface); Q_ASSERT(!m_asyncUpdateFutureInterface);
m_asyncUpdateFutureInterface = new QFutureInterface<void>(); m_asyncUpdateFutureInterface = new QFutureInterface<void>();
Core::ProgressManager *progressManager = Core::ICore::instance()->progressManager(); Core::ProgressManager *progressManager = Core::ICore::instance()->progressManager();
progressManager->addTask(m_asyncUpdateFutureInterface->future(), tr("Evaluate"), Constants::PROFILE_EVALUATE); progressManager->addTask(m_asyncUpdateFutureInterface->future(), tr("Evaluate"), Constants::PROFILE_EVALUATE);
qDebug()<<" adding task"; if (debug)
qDebug()<<" adding task";
m_asyncUpdateFutureInterface->setProgressRange(0, 0); m_asyncUpdateFutureInterface->setProgressRange(0, 0);
m_asyncUpdateFutureInterface->reportStarted(); m_asyncUpdateFutureInterface->reportStarted();
if (m_asyncUpdateState == AsyncFullUpdatePending) { if (m_asyncUpdateState == AsyncFullUpdatePending) {
qDebug()<<" full update, starting with root node"; if (debug)
qDebug()<<" full update, starting with root node";
m_rootProjectNode->asyncUpdate(); m_rootProjectNode->asyncUpdate();
} else { } else {
qDebug()<<" partial update,"<<m_partialEvaluate.size()<<"nodes to update"; if (debug)
qDebug()<<" partial update,"<<m_partialEvaluate.size()<<"nodes to update";
foreach(Qt4ProFileNode *node, m_partialEvaluate) foreach(Qt4ProFileNode *node, m_partialEvaluate)
node->asyncUpdate(); node->asyncUpdate();
} }
m_partialEvaluate.clear(); m_partialEvaluate.clear();
qDebug()<<" Setting state to AsyncUpdateInProgress"; if (debug)
qDebug()<<" Setting state to AsyncUpdateInProgress";
m_asyncUpdateState = AsyncUpdateInProgress; m_asyncUpdateState = AsyncUpdateInProgress;
} }