CMake: Cache cmake configuration only once

This fixes saves memory and fixes some update issues with the cmake
configuration, where the three layers of caches used to interfere
with each other.

Task-number: QTCREATORBUG-17360
Change-Id: I5564bbe46ca8de6b38dd710100bfc18fad98eac5
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
Tobias Hunger
2016-12-01 15:25:32 +01:00
parent 5a88e4c9ad
commit 63c0fbc4e4
8 changed files with 16 additions and 19 deletions

View File

@@ -146,7 +146,7 @@ void CMakeBuildConfiguration::ctor()
connect(m_buildDirManager.get(), &BuildDirManager::errorOccured,
this, &CMakeBuildConfiguration::setError);
connect(m_buildDirManager.get(), &BuildDirManager::configurationStarted,
this, [this]() { m_completeConfigurationCache.clear(); emit parsingStarted(); });
this, &CMakeBuildConfiguration::parsingStarted);
connect(this, &CMakeBuildConfiguration::environmentChanged,
m_buildDirManager.get(), &BuildDirManager::forceReparse);
@@ -259,10 +259,7 @@ QList<ConfigModel::DataItem> CMakeBuildConfiguration::completeCMakeConfiguration
if (!m_buildDirManager || m_buildDirManager->isParsing())
return QList<ConfigModel::DataItem>();
if (m_completeConfigurationCache.isEmpty())
m_completeConfigurationCache = m_buildDirManager->parsedConfiguration();
return Utils::transform(m_completeConfigurationCache,
return Utils::transform(m_buildDirManager->parsedConfiguration(),
[this](const CMakeConfigItem &i) {
ConfigModel::DataItem j;
j.key = QString::fromUtf8(i.key);