Remove debugging output.

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

View File

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