forked from qt-creator/qt-creator
CMake: Pass const QList<const FileNode *> to Directory Readers
This makes sure they need to copy whatever they need. Change-Id: I767ac0c5f54ca1f9f46acdefe4bd7fea35657312 Reviewed-by: Alexander Drozdov <adrozdoff@gmail.com> Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
@@ -194,7 +194,7 @@ Node *Node::trim(const QSet<Node *> &keepers)
|
||||
return keepers.contains(this) ? nullptr : this;
|
||||
}
|
||||
|
||||
bool Node::sortByPath(Node *a, Node *b)
|
||||
bool Node::sortByPath(const Node *a, const Node *b)
|
||||
{
|
||||
return a->filePath() < b->filePath();
|
||||
}
|
||||
@@ -266,10 +266,13 @@ static QList<FileNode *> scanForFilesRecursively(const Utils::FileName &director
|
||||
|
||||
const Utils::FileName entryName = Utils::FileName::fromString(entry.absoluteFilePath());
|
||||
if (!vcsControl || !vcsControl->isVcsFileOrDirectory(entryName)) {
|
||||
if (entry.isDir())
|
||||
if (entry.isDir()) {
|
||||
result.append(scanForFilesRecursively(entryName, factory, visited, future, progress, progressIncrement));
|
||||
else
|
||||
result.append(factory(entryName));
|
||||
} else {
|
||||
FileNode *node = factory(entryName);
|
||||
if (node)
|
||||
result.append(node);
|
||||
}
|
||||
}
|
||||
if (future) {
|
||||
progress += progressIncrement;
|
||||
|
||||
Reference in New Issue
Block a user