forked from qt-creator/qt-creator
ClangTools: Show also diagnostics from project's header files
Fixes: QTCREATORBUG-21452 Change-Id: I73c85224e142f4f1d08c9ada75fe8359ebf0f984 Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
This commit is contained in:
@@ -387,13 +387,24 @@ void ClangToolRunControl::analyzeNextFile()
|
||||
Utils::StdOutFormat);
|
||||
}
|
||||
|
||||
static Utils::FileName cleanPath(const Utils::FileName &filePath)
|
||||
{
|
||||
return Utils::FileName::fromString(QDir::cleanPath(filePath.toString()));
|
||||
}
|
||||
|
||||
void ClangToolRunControl::onRunnerFinishedWithSuccess(const QString &filePath)
|
||||
{
|
||||
const QString logFilePath = qobject_cast<ClangToolRunner *>(sender())->logFilePath();
|
||||
qCDebug(LOG) << "onRunnerFinishedWithSuccess:" << logFilePath;
|
||||
|
||||
QTC_ASSERT(m_projectInfo.project(), return);
|
||||
const Utils::FileName projectRootDir = cleanPath(m_projectInfo.project()->projectDirectory());
|
||||
|
||||
QString errorMessage;
|
||||
const QList<Diagnostic> diagnostics = tool()->read(filePath, logFilePath, &errorMessage);
|
||||
const QList<Diagnostic> diagnostics = tool()->read(filePath,
|
||||
projectRootDir,
|
||||
logFilePath,
|
||||
&errorMessage);
|
||||
QFile::remove(logFilePath); // Clean-up.
|
||||
|
||||
if (!errorMessage.isEmpty()) {
|
||||
|
||||
Reference in New Issue
Block a user