Commit b8ea6e8f authored by Oswald Buddenhagen's avatar Oswald Buddenhagen

remove redundancy from QmakePriFileNode::recursiveEnumerate()

we *know* that this function is called only with folders; it's part of
its api.

Change-Id: Idada1e6672a916c0d550d191770396ebbc54b02f
Reviewed-by: Tobias Hunger's avatarTobias Hunger <tobias.hunger@qt.io>
parent bd3f39a3
...@@ -622,19 +622,13 @@ QStringList QmakePriFileNode::fullVPaths(const QStringList &baseVPaths, QtSuppor ...@@ -622,19 +622,13 @@ QStringList QmakePriFileNode::fullVPaths(const QStringList &baseVPaths, QtSuppor
QSet<FileName> QmakePriFileNode::recursiveEnumerate(const QString &folder) QSet<FileName> QmakePriFileNode::recursiveEnumerate(const QString &folder)
{ {
QSet<FileName> result; QSet<FileName> result;
QFileInfo fi(folder); QDir dir(folder);
if (fi.isDir()) { dir.setFilter(dir.filter() | QDir::NoDotAndDotDot);
QDir dir(folder); foreach (const QFileInfo &file, dir.entryInfoList()) {
dir.setFilter(dir.filter() | QDir::NoDotAndDotDot); if (file.isDir() && !file.isSymLink())
result += recursiveEnumerate(file.absoluteFilePath());
foreach (const QFileInfo &file, dir.entryInfoList()) { else if (!Core::EditorManager::isAutoSaveFile(file.fileName()))
if (file.isDir() && !file.isSymLink()) result += FileName(file);
result += recursiveEnumerate(file.absoluteFilePath());
else if (!Core::EditorManager::isAutoSaveFile(file.fileName()))
result += FileName(file);
}
} else if (fi.exists()) {
result << FileName(fi);
} }
return result; return result;
} }
......
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