diff options
author | Tobias Hunger <tobias.hunger@qt.io> | 2017-11-21 11:06:41 +0100 |
---|---|---|
committer | Eike Ziller <eike.ziller@qt.io> | 2017-11-21 10:19:53 +0000 |
commit | 216e40b3f0fa2e6da85367e8620c8f93f6b3c5b8 (patch) | |
tree | 0eb4805fe3ee7ff329002529fff20fbf8cef37f3 | |
parent | 2abf1f29cc9a17c030b4c402cb11f0526540e895 (diff) |
CMake: Fix tree scanner not getting run automatically
This lead to <Headers> entry being missing from the project tree.
Task-number: QTCREATORBUG-19333
Change-Id: Ice3bab6d92aaa3799e66800cbae0bacd57537322
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
-rw-r--r-- | src/plugins/cmakeprojectmanager/builddirmanager.h | 5 | ||||
-rw-r--r-- | src/plugins/cmakeprojectmanager/cmakeproject.cpp | 27 |
2 files changed, 19 insertions, 13 deletions
diff --git a/src/plugins/cmakeprojectmanager/builddirmanager.h b/src/plugins/cmakeprojectmanager/builddirmanager.h index d703aed5ad0..58fe11484cc 100644 --- a/src/plugins/cmakeprojectmanager/builddirmanager.h +++ b/src/plugins/cmakeprojectmanager/builddirmanager.h @@ -88,8 +88,9 @@ public: REPARSE_URGENT = 1, // Do not wait for more requests, start ASAP REPARSE_FORCE_CONFIGURATION = 2, // Force configuration arguments to cmake REPARSE_CHECK_CONFIGURATION = 4, // Check and warn if on-disk config and QtC config differ - REPARSE_IGNORE = 8, // Do not reparse:-) - REPARSE_FAIL = 16 // Do not reparse and raise a warning + REPARSE_SCAN = 8, + REPARSE_IGNORE = 16, // Do not reparse:-) + REPARSE_FAIL = 32 // Do not reparse and raise a warning }; signals: diff --git a/src/plugins/cmakeprojectmanager/cmakeproject.cpp b/src/plugins/cmakeprojectmanager/cmakeproject.cpp index 81345fee8e4..a47a7ee91e2 100644 --- a/src/plugins/cmakeprojectmanager/cmakeproject.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeproject.cpp @@ -390,25 +390,27 @@ bool CMakeProject::supportsKit(Kit *k, QString *errorMessage) const void CMakeProject::runCMake() { - if (isParsing()) + CMakeBuildConfiguration *bc = activeBc(this); + if (isParsing() || !bc) return; - CMakeBuildConfiguration *bc = activeBc(this); - if (bc) { - BuildDirParameters parameters(bc); - m_buildDirManager.setParametersAndRequestParse(parameters, - BuildDirManager::REPARSE_CHECK_CONFIGURATION, - BuildDirManager::REPARSE_CHECK_CONFIGURATION); - } + BuildDirParameters parameters(bc); + m_buildDirManager.setParametersAndRequestParse(parameters, + BuildDirManager::REPARSE_CHECK_CONFIGURATION, + BuildDirManager::REPARSE_CHECK_CONFIGURATION); } void CMakeProject::runCMakeAndScanProjectTree() { - if (!m_treeScanner.isFinished()) + CMakeBuildConfiguration *bc = activeBc(this); + if (isParsing() || !bc) return; + QTC_ASSERT(m_treeScanner.isFinished(), return); - m_waitingForScan = true; - runCMake(); + BuildDirParameters parameters(bc); + m_buildDirManager.setParametersAndRequestParse(parameters, + BuildDirManager::REPARSE_CHECK_CONFIGURATION | BuildDirManager::REPARSE_SCAN, + BuildDirManager::REPARSE_CHECK_CONFIGURATION | BuildDirManager::REPARSE_SCAN); } void CMakeProject::buildCMakeTarget(const QString &buildTarget) @@ -452,6 +454,8 @@ void CMakeProject::handleReparseRequest(int reparseParameters) m_delayedParsingTimer.setInterval((reparseParameters & BuildDirManager::REPARSE_URGENT) ? 0 : 1000); m_delayedParsingTimer.start(); m_delayedParsingParameters = m_delayedParsingParameters | reparseParameters; + if (m_allFiles.isEmpty()) + m_delayedParsingParameters |= BuildDirManager::REPARSE_SCAN; } void CMakeProject::startParsing(int reparseParameters) @@ -466,6 +470,7 @@ void CMakeProject::startParsing(int reparseParameters) emitParsingStarted(); + m_waitingForScan = reparseParameters & BuildDirManager::REPARSE_SCAN; m_waitingForParse = true; m_combinedScanAndParseResult = true; |