From a46fccda0fa4a1f2900813b3f0e6320c340eb9b3 Mon Sep 17 00:00:00 2001 From: hjk Date: Tue, 4 Dec 2018 12:19:09 +0100 Subject: [PATCH] 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 --- src/plugins/qmakeprojectmanager/qmakeproject.cpp | 10 +++++----- src/plugins/qmakeprojectmanager/qmakeproject.h | 6 ++---- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/plugins/qmakeprojectmanager/qmakeproject.cpp b/src/plugins/qmakeprojectmanager/qmakeproject.cpp index 8c2ded5acd6..6f1cc9ba9ab 100644 --- a/src/plugins/qmakeprojectmanager/qmakeproject.cpp +++ b/src/plugins/qmakeprojectmanager/qmakeproject.cpp @@ -753,21 +753,21 @@ QmakeProFileNode *QmakeProject::rootProjectNode() const return static_cast(Project::rootProjectNode()); } -QList QmakeProject::applicationProFiles(Parsing parse) const +QList QmakeProject::applicationProFiles() const { - return allProFiles({ProjectType::ApplicationTemplate, ProjectType::ScriptTemplate}, parse); + return allProFiles({ProjectType::ApplicationTemplate, ProjectType::ScriptTemplate}); } const QList - QmakeProject::allProFiles(const QList &projectTypes, Parsing parse) const + QmakeProject::allProFiles(const QList &projectTypes) const { QList list; - rootProjectNode()->forEachProjectNode([&list, projectTypes, parse](const ProjectNode *node) { + rootProjectNode()->forEachProjectNode([&list, projectTypes](const ProjectNode *node) { if (auto qmakeNode = dynamic_cast(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); } diff --git a/src/plugins/qmakeprojectmanager/qmakeproject.h b/src/plugins/qmakeprojectmanager/qmakeproject.h index 22060a2a837..3cd96afd369 100644 --- a/src/plugins/qmakeprojectmanager/qmakeproject.h +++ b/src/plugins/qmakeprojectmanager/qmakeproject.h @@ -66,10 +66,8 @@ public: QStringList filesGeneratedFrom(const QString &file) const final; - enum Parsing {ExactParse, ExactAndCumulativeParse }; - const QList allProFiles(const QList &projectTypes = {}, - Parsing parse = ExactParse) const; - QList applicationProFiles(Parsing parse = ExactParse) const; + const QList allProFiles(const QList &projectTypes = {}) const; + QList applicationProFiles() const; static void notifyChanged(const Utils::FileName &name);