forked from qt-creator/qt-creator
Utils: Introduce a TemporaryDirectory and TemporaryFile class
Both wrap the corresponding Qt class, but make sure all temporary files or directories are created inside a "master temporary directory". Change-Id: I55461be507c828c965224c02863ea5ed9bbf9498 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
committed by
Tim Jenssen
parent
e6017c40fc
commit
c6f90e575e
@@ -71,13 +71,13 @@
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/qtcprocess.h>
|
||||
#include <utils/savedaction.h>
|
||||
#include <utils/temporaryfile.h>
|
||||
|
||||
#include <QBuffer>
|
||||
#include <QDirIterator>
|
||||
#include <QMessageBox>
|
||||
#include <QProcess>
|
||||
#include <QPushButton>
|
||||
#include <QTemporaryFile>
|
||||
#include <QJsonArray>
|
||||
|
||||
using namespace Core;
|
||||
@@ -2999,7 +2999,7 @@ static void handleShowModuleSymbols(const DebuggerResponse &response,
|
||||
|
||||
void GdbEngine::requestModuleSymbols(const QString &modulePath)
|
||||
{
|
||||
QTemporaryFile tf(QDir::tempPath() + "/gdbsymbols");
|
||||
Utils::TemporaryFile tf("gdbsymbols");
|
||||
if (!tf.open())
|
||||
return;
|
||||
QString fileName = tf.fileName();
|
||||
@@ -3351,7 +3351,7 @@ void GdbEngine::handleThreadNames(const DebuggerResponse &response)
|
||||
void GdbEngine::createSnapshot()
|
||||
{
|
||||
QString fileName;
|
||||
QTemporaryFile tf(QDir::tempPath() + "/gdbsnapshot");
|
||||
Utils::TemporaryFile tf("gdbsnapshot");
|
||||
if (tf.open()) {
|
||||
fileName = tf.fileName();
|
||||
tf.close();
|
||||
|
||||
Reference in New Issue
Block a user