diff --git a/src/plugins/clangtools/clangtoolruncontrol.cpp b/src/plugins/clangtools/clangtoolruncontrol.cpp index afe3e382c8d..0b4c2524337 100644 --- a/src/plugins/clangtools/clangtoolruncontrol.cpp +++ b/src/plugins/clangtools/clangtoolruncontrol.cpp @@ -406,22 +406,25 @@ void ClangToolRunControl::onRunnerFinishedWithSuccess(const QString &filePath) } void ClangToolRunControl::onRunnerFinishedWithFailure(const QString &errorMessage, - const QString &errorDetails) + const QString &errorDetails) { qCDebug(LOG).noquote() << "onRunnerFinishedWithFailure:" << errorMessage << '\n' << errorDetails; + auto *toolRunner = qobject_cast(sender()); + const QString filePath = toolRunner->filePath(); + const QString logFilePath = toolRunner->logFilePath(); + // Even in the error case the log file was created, so clean it up here, too. - QFile::remove(qobject_cast(sender())->logFilePath()); + QFile::remove(logFilePath); + + const QString message = tr("Failed to analyze \"%1\": %2").arg(filePath, errorMessage); ++m_filesNotAnalyzed; m_success = false; - const QString filePath = qobject_cast(sender())->filePath(); - appendMessage(tr("Failed to analyze \"%1\": %2").arg(filePath, errorMessage), - Utils::StdErrFormat); + appendMessage(message, Utils::StdErrFormat); appendMessage(errorDetails, Utils::StdErrFormat); - TaskHub::addTask(Task::Warning, errorMessage, Debugger::Constants::ANALYZERTASK_ID); - TaskHub::addTask(Task::Warning, errorDetails, Debugger::Constants::ANALYZERTASK_ID); + TaskHub::addTask(Task::Warning, message, Debugger::Constants::ANALYZERTASK_ID); handleFinished(); } diff --git a/src/plugins/clangtools/clangtoolsdiagnosticmodel.cpp b/src/plugins/clangtools/clangtoolsdiagnosticmodel.cpp index bf56f8fb909..6a288a00d2b 100644 --- a/src/plugins/clangtools/clangtoolsdiagnosticmodel.cpp +++ b/src/plugins/clangtools/clangtoolsdiagnosticmodel.cpp @@ -263,7 +263,7 @@ static QVariant iconData(const QString &type) { if (type == "warning") return Utils::Icons::CODEMODEL_WARNING.icon(); - if (type == "error") + if (type == "error" || type == "fatal") return Utils::Icons::CODEMODEL_ERROR.icon(); if (type == "note") return Utils::Icons::BOOKMARK.icon();