ClangTools: Use FilePath in ClangToolRunner::init()

One .path().path() less.

Change-Id: Ibf1b25acefafc1bb5359d839ebf272c3d1fb08d6
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
hjk
2021-07-02 07:12:33 +02:00
parent 579e643f71
commit 9a82846de4
4 changed files with 9 additions and 10 deletions

View File

@@ -78,7 +78,7 @@ ClangToolRunner::~ClangToolRunner()
m_process->deleteLater();
}
void ClangToolRunner::init(const QString &outputDirPath, const Environment &environment)
void ClangToolRunner::init(const FilePath &outputDirPath, const Environment &environment)
{
m_outputDirPath = outputDirPath;
QTC_CHECK(!m_outputDirPath.isEmpty());
@@ -112,15 +112,14 @@ bool ClangToolRunner::supportsVFSOverlay() const
return it.value();
}
static QString createOutputFilePath(const QString &dirPath, const QString &fileToAnalyze)
static QString createOutputFilePath(const FilePath &dirPath, const QString &fileToAnalyze)
{
const QString fileName = QFileInfo(fileToAnalyze).fileName();
const QString fileTemplate = dirPath
+ QLatin1String("/report-") + fileName + QLatin1String("-XXXXXX");
const FilePath fileTemplate = dirPath.pathAppended("report-" + fileName + "-XXXXXX");
Utils::TemporaryFile temporaryFile("clangtools");
TemporaryFile temporaryFile("clangtools");
temporaryFile.setAutoRemove(false);
temporaryFile.setFileTemplate(fileTemplate);
temporaryFile.setFileTemplate(fileTemplate.path());
if (temporaryFile.open()) {
temporaryFile.close();
return temporaryFile.fileName();