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 55b0cc7814

Fixes: QTCREATORBUG-22044
Change-Id: I09e18aebc6727720d45775ec56f55f9f16d43f86
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
Andre Hartmann
2019-02-25 20:47:43 +01:00
committed by André Hartmann
parent b97639158c
commit dac7d4962c

View File

@@ -146,10 +146,12 @@ QString FileInProjectFinder::findFile(const QUrl &fileUrl, bool *success) const
if (fileUrl.scheme() == "qrc" || fileUrl.toString().startsWith(':')) { if (fileUrl.scheme() == "qrc" || fileUrl.toString().startsWith(':')) {
const QString result = m_qrcUrlFinder.find(fileUrl); const QString result = m_qrcUrlFinder.find(fileUrl);
if (!result.isEmpty()) {
if (success) if (success)
*success = !result.isEmpty(); *success = true;
return result; return result;
} }
}
QString originalPath = fileUrl.toLocalFile(); QString originalPath = fileUrl.toLocalFile();
if (originalPath.isEmpty()) // e.g. qrc:// if (originalPath.isEmpty()) // e.g. qrc://