forked from qt-creator/qt-creator
CMake: Cache buildtargets in builddirmanager
No need to have the builddirreaders to so. Change-Id: Ia7e38f6483b29d6a4f4b65baacc17bf184a3cb34 Task-number: QTCREATORBUG-17359 Reviewed-by: Florian Apolloner <florian@apolloner.eu> Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
@@ -142,6 +142,8 @@ void BuildDirManager::updateReaderData()
|
||||
|
||||
void BuildDirManager::parseOnceReaderReady(bool force)
|
||||
{
|
||||
m_buildTargets.clear();
|
||||
|
||||
auto fi = new QFutureInterface<QList<ProjectExplorer::FileNode *>>();
|
||||
m_scanFuture = fi->future();
|
||||
m_futureWatcher.setFuture(m_scanFuture);
|
||||
@@ -302,6 +304,8 @@ void BuildDirManager::resetData()
|
||||
m_cmakeCache.clear();
|
||||
m_futureWatcher.setFuture(QFuture<QList<FileNode *>>());
|
||||
m_reader.reset();
|
||||
|
||||
m_buildTargets.clear();
|
||||
}
|
||||
|
||||
bool BuildDirManager::updateCMakeStateBeforeBuild()
|
||||
@@ -395,7 +399,9 @@ QList<CMakeBuildTarget> BuildDirManager::buildTargets() const
|
||||
{
|
||||
if (!m_reader)
|
||||
return QList<CMakeBuildTarget>();
|
||||
return m_reader->buildTargets();
|
||||
if (m_buildTargets.isEmpty())
|
||||
m_buildTargets = m_reader->buildTargets();
|
||||
return m_buildTargets;
|
||||
}
|
||||
|
||||
CMakeConfig BuildDirManager::parsedConfiguration() const
|
||||
|
||||
Reference in New Issue
Block a user