Skip to content

Commit

Permalink
Utils: Wrap various file system iteration flags and filters
Browse files Browse the repository at this point in the history
... into a single class.

This makes passing them around as a whole easier, and opens a path
to have "generic" filters in form of a lambda or such.

Change-Id: Ibf644b2fedcf0f1a35258030710afff8f5873f88
Reviewed-by: Qt CI Bot <[email protected]>
Reviewed-by: Eike Ziller <[email protected]>
  • Loading branch information
hjk authored and h4tr3d committed Jan 28, 2022
1 parent a532584 commit 7dd5641
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cmakeprojectimporter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ static QStringList scanDirectory(const FilePath &path, const QString &prefix)
QStringList result;
qCDebug(cmInputLog) << "Scanning for directories matching" << prefix << "in" << path;

foreach (const FilePath &entry, path.dirEntries({prefix + "*"}, QDir::Dirs | QDir::NoDotAndDotDot)) {
foreach (const FilePath &entry, path.dirEntries({{prefix + "*"}, QDir::Dirs | QDir::NoDotAndDotDot})) {
QTC_ASSERT(entry.isDir(), continue);
result.append(entry.toString());
}
Expand Down
5 changes: 1 addition & 4 deletions fileapiparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -948,10 +948,7 @@ FilePath FileApiParser::scanForCMakeReplyFile(const FilePath &buildDirectory)
if (!replyDir.exists())
return {};

const FilePaths entries = replyDir.dirEntries({"index-*.json"},
QDir::Files,
QDirIterator::NoIteratorFlags,
QDir::Name);
const FilePaths entries = replyDir.dirEntries({{"index-*.json"}, QDir::Files}, QDir::Name);
return entries.isEmpty() ? FilePath() : entries.first();
}

Expand Down

0 comments on commit 7dd5641

Please sign in to comment.