Commit 04aa6f67 authored by Tobias Hunger's avatar Tobias Hunger Committed by Tim Jenssen

ProjectExplorer: Make scanForFiles cancel-able

Change-Id: Icbc4fa4c84189bd470bd5720a674d11f3e485037
Reviewed-by: Tim Jenssen's avatarTim Jenssen <tim.jenssen@qt.io>
parent 9252a3ae
......@@ -237,6 +237,7 @@ static QList<FileNode *> scanForFilesRecursively(const Utils::FileName &director
double progressStart, double progressRange)
{
QList<FileNode *> result;
const QDir baseDir = QDir(directory.toString());
// Do not follow directory loops:
......@@ -252,6 +253,9 @@ static QList<FileNode *> scanForFilesRecursively(const Utils::FileName &director
const double progressIncrement = progressRange / static_cast<double>(entries.count());
int lastIntProgress = 0;
for (const QFileInfo &entry : entries) {
if (future && future->isCanceled())
return result;
const Utils::FileName entryName = Utils::FileName::fromString(entry.absoluteFilePath());
if (!vcsControl || !vcsControl->isVcsFileOrDirectory(entryName)) {
if (entry.isDir())
......
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