From 2bb24633ac0ad0b8e8e72ef4d0737e30130d946f Mon Sep 17 00:00:00 2001 From: Andre Hartmann Date: Thu, 3 Jan 2019 20:53:24 +0100 Subject: [PATCH] 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 7b0b4c92cdd, which caused the auto tests in QtSupportPlugin::testQtOutputFormatter to fail. Fixes: QTCREATORBUG-21792 Change-Id: I9ed66c86e7a165fe198ee3fcf1bf8b72d850a2d5 Reviewed-by: Orgad Shaneh Reviewed-by: Ulf Hermann --- src/libs/utils/fileinprojectfinder.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/utils/fileinprojectfinder.cpp b/src/libs/utils/fileinprojectfinder.cpp index 33a779a91d2..2be64260e8a 100644 --- a/src/libs/utils/fileinprojectfinder.cpp +++ b/src/libs/utils/fileinprojectfinder.cpp @@ -144,7 +144,7 @@ QString FileInProjectFinder::findFile(const QUrl &fileUrl, bool *success) const if (originalPath.isEmpty()) // e.g. qrc:// originalPath = fileUrl.path(); - QString result; + QString result = originalPath; bool found = findFileOrDirectory(originalPath, [&](const QString &fileName, int) { result = fileName; });