ClangTools: Remove temporary dirs

...when a new run is triggered instead of on Qt Creator shutdown.

There is no reason to keep them around for longer than needed.

Change-Id: Ida7698843cc2f8822ffd662679cf5da2c4ece05c
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
This commit is contained in:
Nikolai Kosjar
2018-06-05 10:37:42 +02:00
parent 71f02417e7
commit b81e5cb3b2
3 changed files with 5 additions and 8 deletions

View File

@@ -60,7 +60,6 @@
#include <utils/algorithm.h>
#include <utils/checkablemessagebox.h>
#include <utils/hostosinfo.h>
#include <utils/temporarydirectory.h>
#include <utils/qtcprocess.h>
#include <QAction>
@@ -232,6 +231,7 @@ ClangToolRunControl::ClangToolRunControl(RunControl *runControl,
: RunWorker(runControl)
, m_projectBuilder(new ProjectBuilder(runControl, target->project(), this))
, m_clangExecutable(CppTools::clangExecutable(CLANG_BINDIR))
, m_temporaryDir("clangtools-XXXXXX")
, m_target(target)
, m_fileInfos(fileInfos)
{
@@ -299,9 +299,7 @@ void ClangToolRunControl::start()
Utils::NormalMessageFormat);
// Create log dir
Utils::TemporaryDirectory temporaryDir("qtc-clangtools-XXXXXX");
temporaryDir.setAutoRemove(false);
if (!temporaryDir.isValid()) {
if (!m_temporaryDir.isValid()) {
const QString errorMessage
= toolName + tr(": Failed to create temporary dir, stop.");
appendMessage(errorMessage, Utils::ErrorMessageFormat);
@@ -310,7 +308,6 @@ void ClangToolRunControl::start()
reportFailure(errorMessage);
return;
}
m_clangLogFileDir = temporaryDir.path();
// Collect files
const AnalyzeUnits unitsToProcess = unitsToAnalyze(CLANG_VERSION);