From 85597f85b0141d71afc604f6bb46a341f2cf8de0 Mon Sep 17 00:00:00 2001 From: hjk Date: Fri, 24 Apr 2020 10:45:20 +0200 Subject: QmakeProjectManager: Fix missing run button activation The problem could be reproduced as follows: - open any bigger qmake based project (e.g. QtCreator) - de-activate all kits - activate one kit - wait until the first parse (e.g. Debug build finished) - switch to Profile, and toggle the Shadow build button The toggling re-starts the parsing. The parse guard will not be released in decrementPendingEvaluateFutures() (arguably correct as the parsing as a whole is not done). On enteringing incrementPendingEvaluateFuture() due to the re-start, the guard still guards the parse, but a new guard is created in guardParsingRun(). As this happens while the build system isParsing() is true, the created parse guard will be "non-guarding". On assigning to m_guard, the original guard object will fire and then be replaced by the non-guarding guard, that never fires again, so the the build system will never have hasParsingData(), which is a condition for the run buttons to activate. As a workaround for people running into this issue in 4.12.0: Select 'Run qmake' from the menu (any subproject suffices), and let it finish. Change-Id: If7a55db56ec67bac2635fb9a745b9aaf6ca6a413 Reviewed-by: Christian Kandeler --- src/plugins/qmakeprojectmanager/qmakeproject.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/plugins/qmakeprojectmanager') diff --git a/src/plugins/qmakeprojectmanager/qmakeproject.cpp b/src/plugins/qmakeprojectmanager/qmakeproject.cpp index 109b9d3d8e..00d23d3f75 100644 --- a/src/plugins/qmakeprojectmanager/qmakeproject.cpp +++ b/src/plugins/qmakeprojectmanager/qmakeproject.cpp @@ -500,8 +500,13 @@ void QmakeBuildSystem::startAsyncTimer(QmakeProFile::AsyncUpdateDelay delay) void QmakeBuildSystem::incrementPendingEvaluateFutures() { - if (m_pendingEvaluateFuturesCount == 0) - m_guard = guardParsingRun(); + if (m_pendingEvaluateFuturesCount == 0) { + // The guard actually might already guard the project if this + // here is the re-start of a previously aborted parse due to e.g. + // changing build directories while parsing. + if (!m_guard.guardsProject()) + m_guard = guardParsingRun(); + } ++m_pendingEvaluateFuturesCount; m_asyncUpdateFutureInterface.setProgressRange(m_asyncUpdateFutureInterface.progressMinimum(), m_asyncUpdateFutureInterface.progressMaximum() + 1); -- cgit v1.2.3