ClangTools: Use FilePath in AnalyzeUnit

Change-Id: Ic8e19053a60e7c4d801f32f9048b7c48d00b2a3d
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
hjk
2023-02-07 18:22:32 +01:00
parent 15841807d5
commit 9ad60cd891
4 changed files with 16 additions and 14 deletions

View File

@@ -189,7 +189,7 @@ void ClangToolRunWorker::start()
const AnalyzeInputData input{tool, m_diagnosticConfig, m_temporaryDir.path(),
m_environment, unit};
const auto setupHandler = [this, unit, tool] {
const QString filePath = FilePath::fromString(unit.file).toUserOutput();
const QString filePath = unit.file.toUserOutput();
appendMessage(Tr::tr("Analyzing \"%1\" [%2].").arg(filePath, clangToolName(tool)),
Utils::StdOutFormat);
return true;
@@ -231,7 +231,7 @@ void ClangToolRunWorker::onDone(const AnalyzeOutputData &output)
m_filesNotAnalyzed.insert(output.fileToAnalyze);
const QString message = Tr::tr("Failed to analyze \"%1\": %2")
.arg(output.fileToAnalyze, output.errorMessage);
.arg(output.fileToAnalyze.toUserOutput(), output.errorMessage);
appendMessage(message, Utils::StdErrFormat);
appendMessage(output.errorDetails, Utils::StdErrFormat);
return;
@@ -247,7 +247,8 @@ void ClangToolRunWorker::onDone(const AnalyzeOutputData &output)
m_filesAnalyzed.remove(output.fileToAnalyze);
m_filesNotAnalyzed.insert(output.fileToAnalyze);
qCDebug(LOG) << "onRunnerFinishedWithSuccess: Error reading log file:" << errorMessage;
appendMessage(Tr::tr("Failed to analyze \"%1\": %2").arg(output.fileToAnalyze, errorMessage),
appendMessage(Tr::tr("Failed to analyze \"%1\": %2")
.arg(output.fileToAnalyze.toUserOutput(), errorMessage),
Utils::StdErrFormat);
} else {
if (!m_filesNotAnalyzed.contains(output.fileToAnalyze))