forked from qt-creator/qt-creator
Utils: Simplify part of OutputLineParser::absoluteFilePath
Change-Id: I65be5e622b2a2bde8cbd25c8642c87f889ee5bdd Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
@@ -115,13 +115,13 @@ FilePath OutputLineParser::absoluteFilePath(const FilePath &filePath) const
|
|||||||
{
|
{
|
||||||
if (filePath.isEmpty())
|
if (filePath.isEmpty())
|
||||||
return filePath;
|
return filePath;
|
||||||
if (filePath.toFileInfo().isAbsolute())
|
if (filePath.isAbsolutePath())
|
||||||
return filePath.cleanPath();
|
return filePath.cleanPath();
|
||||||
FilePaths candidates;
|
FilePaths candidates;
|
||||||
for (const FilePath &dir : searchDirectories()) {
|
for (const FilePath &dir : searchDirectories()) {
|
||||||
FilePath candidate = dir.pathAppended(filePath.toString());
|
FilePath candidate = dir.resolvePath(filePath);
|
||||||
if (candidate.exists() || d->skipFileExistsCheck) {
|
if (candidate.exists() || d->skipFileExistsCheck) {
|
||||||
candidate = FilePath::fromString(QDir::cleanPath(candidate.toString()));
|
candidate = candidate.cleanPath();
|
||||||
if (!candidates.contains(candidate))
|
if (!candidates.contains(candidate))
|
||||||
candidates << candidate;
|
candidates << candidate;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user