diff options
author | Eike Ziller <eike.ziller@qt.io> | 2018-05-28 11:05:37 +0200 |
---|---|---|
committer | Eike Ziller <eike.ziller@qt.io> | 2018-05-28 13:45:20 +0000 |
commit | 6e66b2a078c53c3c2ce18578acfd346274213762 (patch) | |
tree | f775c74fcf1a149654ac51e2084259bae81ea621 /src/plugins/projectexplorer/jsonwizard | |
parent | 8d9942300f715a4b9355062c3b709698ec6ea1f1 (diff) |
Remove some lambdas from Utils::transform calls
It is often possible to user (member) functions or members directly.
That improves readablility and potentially reduces the total number of
symbols.
Also use qobject_container_cast at places where it is appropriate.
Change-Id: Ia2591bca356591e001e2c53eeebcf753e5bc3c37
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
Diffstat (limited to 'src/plugins/projectexplorer/jsonwizard')
-rw-r--r-- | src/plugins/projectexplorer/jsonwizard/jsonsummarypage.cpp | 3 | ||||
-rw-r--r-- | src/plugins/projectexplorer/jsonwizard/jsonwizardfilegenerator.cpp | 2 |
2 files changed, 2 insertions, 3 deletions
diff --git a/src/plugins/projectexplorer/jsonwizard/jsonsummarypage.cpp b/src/plugins/projectexplorer/jsonwizard/jsonsummarypage.cpp index 840c59d0f2..9f9844c01e 100644 --- a/src/plugins/projectexplorer/jsonwizard/jsonsummarypage.cpp +++ b/src/plugins/projectexplorer/jsonwizard/jsonsummarypage.cpp @@ -166,8 +166,7 @@ void JsonSummaryPage::cleanupPage() void JsonSummaryPage::triggerCommit(const JsonWizard::GeneratorFiles &files) { GeneratedFiles coreFiles - = Utils::transform(files, [](const JsonWizard::GeneratorFile &f) -> GeneratedFile - { return f.file; }); + = Utils::transform(files, &JsonWizard::GeneratorFile::file); QString errorMessage; if (!runVersionControl(coreFiles, &errorMessage)) { diff --git a/src/plugins/projectexplorer/jsonwizard/jsonwizardfilegenerator.cpp b/src/plugins/projectexplorer/jsonwizard/jsonwizardfilegenerator.cpp index ab0f31e1e0..5e599c39de 100644 --- a/src/plugins/projectexplorer/jsonwizard/jsonwizardfilegenerator.cpp +++ b/src/plugins/projectexplorer/jsonwizard/jsonwizardfilegenerator.cpp @@ -189,7 +189,7 @@ Core::GeneratedFiles JsonWizardFileGenerator::fileList(Utils::MacroExpander *exp = Utils::partition(concreteFiles, [](const File &f) { return !QFileInfo(f.source).isDir(); }); const QSet<QString> knownFiles - = QSet<QString>::fromList(Utils::transform(fileList, [](const File &f) { return f.target; })); + = QSet<QString>::fromList(Utils::transform(fileList, &File::target)); foreach (const File &dir, dirList) { QDir sourceDir(dir.source); |