From 70a7f80dba16413fda9247ab9886fc510d5ffe4d Mon Sep 17 00:00:00 2001 From: hjk Date: Thu, 23 Feb 2017 12:19:23 +0100 Subject: [PATCH] Nim: Adapt file collecting code to new infrastructure Change-Id: Iaeb931cb93a6020ef40f071fe1b3b51d411d2790 Reviewed-by: Filippo Cucchetto Reviewed-by: hjk --- src/plugins/nim/project/nimproject.cpp | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/src/plugins/nim/project/nimproject.cpp b/src/plugins/nim/project/nimproject.cpp index b023421e6bd..8f2d541f32d 100644 --- a/src/plugins/nim/project/nimproject.cpp +++ b/src/plugins/nim/project/nimproject.cpp @@ -185,19 +185,10 @@ bool NimProject::supportsKit(Kit *k, QString *errorMessage) const FileNameList NimProject::nimFiles() const { FileNameList result; - - QQueue folders; - folders.enqueue(rootProjectNode()); - - while (!folders.isEmpty()) { - FolderNode *folder = folders.takeFirst(); - for (FileNode *file : folder->fileNodes()) { - if (file->displayName().endsWith(QLatin1String(".nim"))) - result.append(file->filePath()); - } - folders.append(folder->folderNodes()); - } - + rootProjectNode()->forEachNode([&](FileNode *file) { + if (file->displayName().endsWith(QLatin1String(".nim"))) + result.append(file->filePath()); + }); return result; }