aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/plugins/cmakeprojectmanager/builddirmanager.h5
-rw-r--r--src/plugins/cmakeprojectmanager/cmakeproject.cpp27
2 files changed, 19 insertions, 13 deletions
diff --git a/src/plugins/cmakeprojectmanager/builddirmanager.h b/src/plugins/cmakeprojectmanager/builddirmanager.h
index d703aed5ad..58fe11484c 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 81345fee8e..a47a7ee91e 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;