FileInProjectFinder: Fix findFile() for nonexisting files

The comment above this function says:

 If all fails, it returns the original path
 from the file URL.

That broke with 7b0b4c92cd, which caused the auto
tests in QtSupportPlugin::testQtOutputFormatter
to fail.

Fixes: QTCREATORBUG-21792
Change-Id: I9ed66c86e7a165fe198ee3fcf1bf8b72d850a2d5
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
This commit is contained in:
Andre Hartmann
2019-01-03 20:53:24 +01:00
committed by André Hartmann
parent 4cc32d411a
commit 2bb24633ac

View File

@@ -144,7 +144,7 @@ QString FileInProjectFinder::findFile(const QUrl &fileUrl, bool *success) const
if (originalPath.isEmpty()) // e.g. qrc:// if (originalPath.isEmpty()) // e.g. qrc://
originalPath = fileUrl.path(); originalPath = fileUrl.path();
QString result; QString result = originalPath;
bool found = findFileOrDirectory(originalPath, [&](const QString &fileName, int) { bool found = findFileOrDirectory(originalPath, [&](const QString &fileName, int) {
result = fileName; result = fileName;
}); });