Skip to content

Commit

Permalink
CMake: Use FilePath::dirEntries file api parser
Browse files Browse the repository at this point in the history
Change-Id: Id83284518029414721cf1a44111d8f63cae9246f
Reviewed-by: Christian Stenger <[email protected]>
  • Loading branch information
hjk authored and h4tr3d committed Jul 8, 2021
1 parent a1b9ed6 commit 25705e4
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions fileapiparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -948,16 +948,12 @@ FileApiData FileApiParser::parseData(QFutureInterface<std::shared_ptr<FileApiQtc

FilePath FileApiParser::scanForCMakeReplyFile(const FilePath &buildDirectory)
{
QTC_CHECK(!buildDirectory.needsDevice());
QDir replyDir(cmakeReplyDirectory(buildDirectory).path());
const FilePath replyDir = cmakeReplyDirectory(buildDirectory);
if (!replyDir.exists())
return {};

const QFileInfoList fis = replyDir.entryInfoList(QStringList("index-*.json"),
QDir::Files,
QDir::Name);
const QFileInfo fi = fis.isEmpty() ? QFileInfo() : fis.last();
return FilePath::fromFileInfo(fi);
const FilePaths entries = replyDir.dirEntries({"index-*.json"}, QDir::Files, QDir::Name);
return entries.isEmpty() ? FilePath() : entries.first();
}

FilePaths FileApiParser::cmakeQueryFilePaths(const FilePath &buildDirectory)
Expand Down

0 comments on commit 25705e4

Please sign in to comment.