Commit cd436a04 authored by Friedrich W. H. Kossebau's avatar Friedrich W. H. Kossebau
Browse files

custommake: port foreach -> range-based for

parent 3abee5e5
...@@ -223,8 +223,8 @@ static bool isMakefile(const QString& fileName) ...@@ -223,8 +223,8 @@ static bool isMakefile(const QString& fileName)
void CustomMakeManager::createTargetItems(IProject* project, const Path& path, ProjectBaseItem* parent) void CustomMakeManager::createTargetItems(IProject* project, const Path& path, ProjectBaseItem* parent)
{ {
Q_ASSERT(isMakefile(path.lastPathSegment())); Q_ASSERT(isMakefile(path.lastPathSegment()));
foreach(const QString& target, parseCustomMakeFile( path )) const auto targets = parseCustomMakeFile(path);
{ for (const QString& target : targets) {
if (!isValid(Path(parent->path(), target), false, project)) { if (!isValid(Path(parent->path(), target), false, project)) {
continue; continue;
} }
...@@ -248,7 +248,8 @@ void CustomMakeManager::reloadMakefile(ProjectFileItem* file) ...@@ -248,7 +248,8 @@ void CustomMakeManager::reloadMakefile(ProjectFileItem* file)
} }
ProjectBaseItem* parent = file->parent(); ProjectBaseItem* parent = file->parent();
// remove the items that are Makefile targets // remove the items that are Makefile targets
foreach(ProjectBaseItem* item, parent->children()){ const auto items = parent->children();
for (ProjectBaseItem* item : items) {
if (item->target()){ if (item->target()){
delete item; delete item;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment