QMake: Make signalling of parsing state more robust

Move the emitParsingStarted into a location that is called
from both methods that had it before.

Also add an QTC_ASSERT into incrementPending, which is
triggered by the qmake parsing code directly. If something went
wrong before, then the signal will be sent anyway and in the
right sequence -- although the start signal is a bit late at
that point.

Task-number: QTCREATORBUG-20203
Change-Id: I64611e471d1e4959d5cfe0118223594a04238433
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Tobias Hunger
2018-04-13 12:33:31 +02:00
parent 54f024dba4
commit fa11070977

View File

@@ -421,7 +421,6 @@ void QmakeProject::scheduleAsyncUpdate(QmakeProFile *file, QmakeProFile::AsyncUp
return;
}
emitParsingStarted();
file->setParseInProgressRecursive(true);
setAllBuildConfigurationsEnabled(false);
@@ -478,7 +477,6 @@ void QmakeProject::scheduleAsyncUpdate(QmakeProFile::AsyncUpdateDelay delay)
return;
}
emitParsingStarted();
rootProFile()->setParseInProgressRecursive(true);
setAllBuildConfigurationsEnabled(false);
@@ -501,12 +499,15 @@ void QmakeProject::startAsyncTimer(QmakeProFile::AsyncUpdateDelay delay)
m_asyncUpdateTimer.stop();
m_asyncUpdateTimer.setInterval(qMin(m_asyncUpdateTimer.interval(),
delay == QmakeProFile::ParseLater ? UPDATE_INTERVAL : 0));
if (!isParsing())
emitParsingStarted();
m_asyncUpdateTimer.start();
}
void QmakeProject::incrementPendingEvaluateFutures()
{
++m_pendingEvaluateFuturesCount;
QTC_ASSERT(isParsing(), emitParsingStarted());
m_asyncUpdateFutureInterface->setProgressRange(m_asyncUpdateFutureInterface->progressMinimum(),
m_asyncUpdateFutureInterface->progressMaximum() + 1);
}