Project: Avoid copying the entire files(...) list

Avoid copying the entire list of files known to a project just to
filter out a couple of files from it.

Change-Id: I58b2e323f9678058ba482353eb777a55189fe05d
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
Tobias Hunger
2019-06-18 16:21:56 +02:00
parent 30df84e177
commit e2d6c0bfea
6 changed files with 29 additions and 22 deletions

View File

@@ -634,9 +634,12 @@ QStringList CMakeProject::filesGeneratedFrom(const QString &sourceFile) const
ProjectExplorer::DeploymentKnowledge CMakeProject::deploymentKnowledge() const
{
return contains(files(AllFiles), [](const FilePath &f) {
return f.fileName() == "QtCreatorDeployment.txt";
}) ? DeploymentKnowledge::Approximative : DeploymentKnowledge::Bad;
return !files([](const ProjectExplorer::Node *n) {
return n->filePath().fileName() == "QtCreatorDeployment.txt";
})
.isEmpty()
? DeploymentKnowledge::Approximative
: DeploymentKnowledge::Bad;
}
MakeInstallCommand CMakeProject::makeInstallCommand(const Target *target,