Clang: Use Utils::TemporaryDirectory

Task-number: QTCREATORBUG-17401
Change-Id: Ibf6007455ec92b1d9fcac17e1f3b5e2af21b7438
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
This commit is contained in:
Nikolai Kosjar
2017-01-30 10:05:42 +01:00
parent e03132f517
commit 340063c624
6 changed files with 34 additions and 14 deletions

View File

@@ -33,7 +33,6 @@
#include <QCoreApplication>
#include <QMetaMethod>
#include <QProcess>
#include <QTemporaryDir>
#include <QThread>
namespace ClangBackEnd {
@@ -221,8 +220,7 @@ void ConnectionClient::printStandardError()
void ConnectionClient::resetTemporaryDir()
{
const QString templatePath = QDir::tempPath() + QStringLiteral("/qtc-clang-XXXXXX");
temporaryDirectory_.reset(new QTemporaryDir(templatePath));
temporaryDirectory_ = std::make_unique<Utils::TemporaryDirectory>("clang-XXXXXX");
}
void ConnectionClient::connectLocalSocketConnected()

View File

@@ -28,6 +28,8 @@
#include "clangcodemodelserverproxy.h"
#include "lineprefixer.h"
#include <utils/temporarydirectory.h>
#include <QLocalSocket>
#include <QProcessEnvironment>
#include <QScopedPointer>
@@ -124,7 +126,7 @@ private:
mutable std::unique_ptr<QProcess> process_;
QLocalSocket localSocket;
std::unique_ptr<QTemporaryDir> temporaryDirectory_;
std::unique_ptr<Utils::TemporaryDirectory> temporaryDirectory_;
QTimer processAliveTimer;
QString processPath_;
bool isAliveTimerResetted = false;