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
@@ -41,13 +41,13 @@
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/runextensions.h>
|
||||
#include <utils/synchronousprocess.h>
|
||||
#include <utils/temporaryfile.h>
|
||||
|
||||
#include <chrono>
|
||||
#include <memory>
|
||||
#include <QApplication>
|
||||
#include <QDir>
|
||||
#include <QTime>
|
||||
#include <QTemporaryFile>
|
||||
#include <QTcpServer>
|
||||
#include <QTcpSocket>
|
||||
|
||||
@@ -495,7 +495,7 @@ void AndroidRunnerWorker::asyncStart(const QString &intentName,
|
||||
} else {
|
||||
// Handling ping.
|
||||
for (int i = 0; ; ++i) {
|
||||
QTemporaryFile tmp(QDir::tempPath() + "/pingpong");
|
||||
Utils::TemporaryFile tmp("pingpong");
|
||||
tmp.open();
|
||||
tmp.close();
|
||||
|
||||
@@ -563,7 +563,7 @@ void AndroidRunnerWorker::handleRemoteDebuggerRunning()
|
||||
m_socket->waitForBytesWritten();
|
||||
m_socket->close();
|
||||
} else {
|
||||
QTemporaryFile tmp(QDir::tempPath() + "/pingpong");
|
||||
Utils::TemporaryFile tmp("pingpong");
|
||||
tmp.open();
|
||||
|
||||
runAdb(selector() << "push" << tmp.fileName() << m_pongFile);
|
||||
|
||||
Reference in New Issue
Block a user