ProjectExplorer: Remove versionControls argument from scanForFiles

Retrieving the list is cheap, there's no reason to store it and pass
it through all these functions.

Change-Id: I394b512c113af92f60cfb8c2f6561d1617d9cd36
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Orgad Shaneh
2018-09-30 08:55:19 +03:00
committed by Orgad Shaneh
parent 377f5badd8
commit 2f6c6b632c
5 changed files with 16 additions and 27 deletions

View File

@@ -113,11 +113,9 @@ void NimProject::collectProjectFiles()
m_lastProjectScan.start();
QTC_ASSERT(!m_futureWatcher.future().isRunning(), return);
FileName prjDir = projectDirectory();
const QList<Core::IVersionControl *> versionControls = Core::VcsManager::versionControls();
QFuture<QList<ProjectExplorer::FileNode *>> future = Utils::runAsync([prjDir, versionControls] {
return FileNode::scanForFilesWithVersionControls(
prjDir, [](const FileName &fn) { return new FileNode(fn, FileType::Source, false); },
versionControls);
QFuture<QList<ProjectExplorer::FileNode *>> future = Utils::runAsync([prjDir] {
return FileNode::scanForFiles(
prjDir, [](const FileName &fn) { return new FileNode(fn, FileType::Source, false); });
});
m_futureWatcher.setFuture(future);
Core::ProgressManager::addTask(future, tr("Scanning for Nim files"), "Nim.Project.Scan");