From fa11070977ea65e2e1d3a94e5c8c980494388294 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Fri, 13 Apr 2018 12:33:31 +0200 Subject: [PATCH] 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 --- src/plugins/qmakeprojectmanager/qmakeproject.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/plugins/qmakeprojectmanager/qmakeproject.cpp b/src/plugins/qmakeprojectmanager/qmakeproject.cpp index 44ebc927b66..1bc2feaa94e 100644 --- a/src/plugins/qmakeprojectmanager/qmakeproject.cpp +++ b/src/plugins/qmakeprojectmanager/qmakeproject.cpp @@ -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); }