ProjectExplorer: Pass extra project files as QSet

They are available in some cases as such, and consumed as such.

Change-Id: I9866c7d7bd817fb19a8b11a0efbe583ed55fe393
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
hjk
2020-03-02 18:34:12 +01:00
parent 757628bf4a
commit b0b50257ec
14 changed files with 22 additions and 22 deletions

View File

@@ -390,7 +390,7 @@ void BuildDirManager::parse()
reparseParameters & REPARSE_FORCE_CONFIGURATION);
}
QVector<FilePath> BuildDirManager::takeProjectFilesToWatch()
QSet<FilePath> BuildDirManager::projectFilesToWatch() const
{
QTC_ASSERT(!m_isHandlingError, return {});
QTC_ASSERT(m_reader, return {});
@@ -398,7 +398,7 @@ QVector<FilePath> BuildDirManager::takeProjectFilesToWatch()
Utils::FilePath sourceDir = m_parameters.sourceDirectory;
Utils::FilePath buildDir = m_parameters.workDirectory;
return Utils::filtered(m_reader->takeProjectFilesToWatch(),
return Utils::filtered(m_reader->projectFilesToWatch(),
[&sourceDir,
&buildDir](const Utils::FilePath &p) {
return p.isChildOf(sourceDir)

View File

@@ -89,7 +89,7 @@ public:
bool isFilesystemScanRequested() const;
void parse();
QVector<Utils::FilePath> takeProjectFilesToWatch();
QSet<Utils::FilePath> projectFilesToWatch() const;
std::unique_ptr<CMakeProjectNode> generateProjectTree(const QList<const ProjectExplorer::FileNode *> &allFiles,
QString &errorMessage) const;
ProjectExplorer::RawProjectParts createRawProjectParts(QString &errorMessage) const;

View File

@@ -63,7 +63,7 @@ public:
virtual bool isParsing() const = 0;
virtual QVector<Utils::FilePath> takeProjectFilesToWatch() = 0;
virtual QSet<Utils::FilePath> projectFilesToWatch() const = 0;
virtual QList<CMakeBuildTarget> takeBuildTargets(QString &errorMessage) = 0;
virtual CMakeConfig takeParsedConfiguration(QString &errorMessage) = 0;
virtual std::unique_ptr<CMakeProjectNode> generateProjectTree(

View File

@@ -409,7 +409,7 @@ void CMakeBuildSystem::updateProjectData()
QTC_ASSERT(m_treeScanner.isFinished() && !m_buildDirManager.isParsing(), return);
m_buildConfiguration->project()->setExtraProjectFiles(m_buildDirManager.takeProjectFilesToWatch());
m_buildConfiguration->project()->setExtraProjectFiles(m_buildDirManager.projectFilesToWatch());
CMakeConfig patchedConfig = m_buildConfiguration->configurationFromCMake();
{

View File

@@ -164,9 +164,9 @@ bool FileApiReader::isParsing() const
return m_isParsing;
}
QVector<FilePath> FileApiReader::takeProjectFilesToWatch()
QSet<FilePath> FileApiReader::projectFilesToWatch() const
{
return QVector<FilePath>::fromList(Utils::toList(m_cmakeFiles));
return m_cmakeFiles;
}
QList<CMakeBuildTarget> FileApiReader::takeBuildTargets(QString &errorMessage){

View File

@@ -62,7 +62,7 @@ public:
bool isParsing() const final;
QVector<Utils::FilePath> takeProjectFilesToWatch() final;
QSet<Utils::FilePath> projectFilesToWatch() const final;
QList<CMakeBuildTarget> takeBuildTargets(QString &errorMessage) final;
CMakeConfig takeParsedConfiguration(QString &errorMessage) final;
std::unique_ptr<CMakeProjectNode> generateProjectTree(

View File

@@ -55,7 +55,7 @@ public:
bool isParsing() const final;
QVector<Utils::FilePath> takeProjectFilesToWatch() final { return {}; };
QSet<Utils::FilePath> projectFilesToWatch() const final { return {}; };
QList<CMakeBuildTarget> takeBuildTargets(QString &errorMessage) final;
CMakeConfig takeParsedConfiguration(QString &errorMessage) final;
std::unique_ptr<CMakeProjectNode> generateProjectTree(

View File

@@ -160,9 +160,9 @@ bool TeaLeafReader::isParsing() const
return m_cmakeProcess && m_cmakeProcess->state() != QProcess::NotRunning;
}
QVector<FilePath> TeaLeafReader::takeProjectFilesToWatch()
QSet<FilePath> TeaLeafReader::projectFilesToWatch() const
{
return transform<QVector>(m_cmakeFiles, [](const FilePath &p) { return p; });
return m_cmakeFiles;
}
QList<CMakeBuildTarget> TeaLeafReader::takeBuildTargets(QString &errorMessage)

View File

@@ -54,7 +54,7 @@ public:
bool isParsing() const final;
QVector<Utils::FilePath> takeProjectFilesToWatch() final;
QSet<Utils::FilePath> projectFilesToWatch() const final;
QList<CMakeBuildTarget> takeBuildTargets(QString &errorMessage) final;
CMakeConfig takeParsedConfiguration(QString &errorMessage) final;
std::unique_ptr<CMakeProjectNode> generateProjectTree(