From dac7d4962c09d1f25af7a4a0c441099a1652be38 Mon Sep 17 00:00:00 2001 From: Andre Hartmann Date: Mon, 25 Feb 2019 20:47:43 +0100 Subject: [PATCH] QtSupport: Fix QtOutputFormatter auto tests The comment above FileInProjectFinder::findFile() states: "If all fails, it returns the original path from the file URL." So if nothing was found in the resource, fall back to this strategy. Broken by 55b0cc7814f2 Fixes: QTCREATORBUG-22044 Change-Id: I09e18aebc6727720d45775ec56f55f9f16d43f86 Reviewed-by: Christian Kandeler --- src/libs/utils/fileinprojectfinder.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/libs/utils/fileinprojectfinder.cpp b/src/libs/utils/fileinprojectfinder.cpp index 90be2416961..04495893920 100644 --- a/src/libs/utils/fileinprojectfinder.cpp +++ b/src/libs/utils/fileinprojectfinder.cpp @@ -146,9 +146,11 @@ QString FileInProjectFinder::findFile(const QUrl &fileUrl, bool *success) const if (fileUrl.scheme() == "qrc" || fileUrl.toString().startsWith(':')) { const QString result = m_qrcUrlFinder.find(fileUrl); - if (success) - *success = !result.isEmpty(); - return result; + if (!result.isEmpty()) { + if (success) + *success = true; + return result; + } } QString originalPath = fileUrl.toLocalFile();