QmakeProject: Simplify interface

From the QmakeProject::Parsing enum only the ExactParse was used
via function default parameters and always compared to the
ExactAndCumulativeParse value.

This has been like that since at least 4.4 (proably longer), so
it's fair to assume it's not needed.

Change-Id: I46c227cf1fa6e6aea0b184b49937e7cb129db635
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
hjk
2018-12-04 12:19:09 +01:00
parent 667ad61710
commit a46fccda0f
2 changed files with 7 additions and 9 deletions

View File

@@ -753,21 +753,21 @@ QmakeProFileNode *QmakeProject::rootProjectNode() const
return static_cast<QmakeProFileNode *>(Project::rootProjectNode());
}
QList<const QmakeProFileNode *> QmakeProject::applicationProFiles(Parsing parse) const
QList<const QmakeProFileNode *> QmakeProject::applicationProFiles() const
{
return allProFiles({ProjectType::ApplicationTemplate, ProjectType::ScriptTemplate}, parse);
return allProFiles({ProjectType::ApplicationTemplate, ProjectType::ScriptTemplate});
}
const QList<const QmakeProFileNode *>
QmakeProject::allProFiles(const QList<ProjectType> &projectTypes, Parsing parse) const
QmakeProject::allProFiles(const QList<ProjectType> &projectTypes) const
{
QList<const QmakeProFileNode *> list;
rootProjectNode()->forEachProjectNode([&list, projectTypes, parse](const ProjectNode *node) {
rootProjectNode()->forEachProjectNode([&list, projectTypes](const ProjectNode *node) {
if (auto qmakeNode = dynamic_cast<const QmakeProFileNode *>(node)) {
QmakeProFile *file = qmakeNode->proFile();
QTC_ASSERT(file, return);
if (parse == ExactAndCumulativeParse || file->includedInExactParse()) {
if (file->includedInExactParse()) {
if (projectTypes.isEmpty() || projectTypes.contains(file->projectType()))
list.append(qmakeNode);
}

View File

@@ -66,10 +66,8 @@ public:
QStringList filesGeneratedFrom(const QString &file) const final;
enum Parsing {ExactParse, ExactAndCumulativeParse };
const QList<const QmakeProFileNode *> allProFiles(const QList<ProjectType> &projectTypes = {},
Parsing parse = ExactParse) const;
QList<const QmakeProFileNode *> applicationProFiles(Parsing parse = ExactParse) const;
const QList<const QmakeProFileNode *> allProFiles(const QList<ProjectType> &projectTypes = {}) const;
QList<const QmakeProFileNode *> applicationProFiles() const;
static void notifyChanged(const Utils::FileName &name);