forked from qt-creator/qt-creator
CMake: Use Utils::algorithm
Change-Id: I6d15c9e68c2e9680668509022d8a771e4c7c595a Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
This commit is contained in:
@@ -404,22 +404,18 @@ QList<CMakeBuildTarget> CMakeProject::buildTargets() const
|
||||
|
||||
QStringList CMakeProject::buildTargetTitles(bool runnable) const
|
||||
{
|
||||
QStringList results;
|
||||
foreach (const CMakeBuildTarget &ct, m_buildTargets) {
|
||||
if (runnable && (ct.executable.isEmpty() || ct.targetType != ExecutableType))
|
||||
continue;
|
||||
results << ct.title;
|
||||
}
|
||||
return results;
|
||||
const QList<CMakeBuildTarget> targets
|
||||
= runnable ? Utils::filtered(m_buildTargets,
|
||||
[](const CMakeBuildTarget &ct) {
|
||||
return !ct.executable.isEmpty() && ct.targetType == ExecutableType;
|
||||
})
|
||||
: m_buildTargets;
|
||||
return Utils::transform(targets, [](const CMakeBuildTarget &ct) { return ct.title; });
|
||||
}
|
||||
|
||||
bool CMakeProject::hasBuildTarget(const QString &title) const
|
||||
{
|
||||
foreach (const CMakeBuildTarget &ct, m_buildTargets) {
|
||||
if (ct.title == title)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return Utils::anyOf(m_buildTargets, [title](const CMakeBuildTarget &ct) { return ct.title == title; });
|
||||
}
|
||||
|
||||
void CMakeProject::gatherFileNodes(ProjectExplorer::FolderNode *parent, QList<ProjectExplorer::FileNode *> &list)
|
||||
|
Reference in New Issue
Block a user