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
@@ -31,8 +31,10 @@
|
|||||||
#include <extensionsystem/pluginmanager.h>
|
#include <extensionsystem/pluginmanager.h>
|
||||||
#include <extensionsystem/pluginspec.h>
|
#include <extensionsystem/pluginspec.h>
|
||||||
#include <qtsingleapplication.h>
|
#include <qtsingleapplication.h>
|
||||||
|
|
||||||
#include <utils/fileutils.h>
|
#include <utils/fileutils.h>
|
||||||
#include <utils/hostosinfo.h>
|
#include <utils/hostosinfo.h>
|
||||||
|
#include <utils/temporarydirectory.h>
|
||||||
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
@@ -278,6 +280,8 @@ void loadFonts()
|
|||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
|
Utils::TemporaryDirectory::setMasterTemporaryDirectory(QDir::tempPath() + "/QtCreator-XXXXXX");
|
||||||
|
|
||||||
const char *highDpiEnvironmentVariable = setHighDpiEnvironmentVariable();
|
const char *highDpiEnvironmentVariable = setHighDpiEnvironmentVariable();
|
||||||
|
|
||||||
QLoggingCategory::setFilterRules(QLatin1String("qtc.*.debug=false\nqtc.*.info=false"));
|
QLoggingCategory::setFilterRules(QLatin1String("qtc.*.debug=false\nqtc.*.info=false"));
|
||||||
@@ -345,11 +349,9 @@ int main(int argc, char **argv)
|
|||||||
testOptionProvided = true;
|
testOptionProvided = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
QScopedPointer<QTemporaryDir> temporaryCleanSettingsDir;
|
QScopedPointer<Utils::TemporaryDirectory> temporaryCleanSettingsDir;
|
||||||
if (settingsPath.isEmpty() && testOptionProvided) {
|
if (settingsPath.isEmpty() && testOptionProvided) {
|
||||||
const QString settingsPathTemplate = QDir::cleanPath(QDir::tempPath()
|
temporaryCleanSettingsDir.reset(new Utils::TemporaryDirectory("qtc-test-settings"));
|
||||||
+ QString::fromLatin1("/qtc-test-settings-XXXXXX"));
|
|
||||||
temporaryCleanSettingsDir.reset(new QTemporaryDir(settingsPathTemplate));
|
|
||||||
if (!temporaryCleanSettingsDir->isValid())
|
if (!temporaryCleanSettingsDir->isValid())
|
||||||
return 1;
|
return 1;
|
||||||
settingsPath = temporaryCleanSettingsDir->path();
|
settingsPath = temporaryCleanSettingsDir->path();
|
||||||
|
|||||||
@@ -26,7 +26,6 @@
|
|||||||
#include "clangcodemodelconnectionclient.h"
|
#include "clangcodemodelconnectionclient.h"
|
||||||
|
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
#include <QTemporaryDir>
|
|
||||||
|
|
||||||
namespace ClangBackEnd {
|
namespace ClangBackEnd {
|
||||||
|
|
||||||
|
|||||||
@@ -37,7 +37,6 @@
|
|||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
class QProcess;
|
class QProcess;
|
||||||
class QTemporaryDir;
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
class Utf8String;
|
class Utf8String;
|
||||||
|
|||||||
57
src/libs/utils/temporarydirectory.cpp
Normal file
57
src/libs/utils/temporarydirectory.cpp
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** Copyright (C) 2016 The Qt Company Ltd.
|
||||||
|
** Contact: https://www.qt.io/licensing/
|
||||||
|
**
|
||||||
|
** This file is part of Qt Creator.
|
||||||
|
**
|
||||||
|
** Commercial License Usage
|
||||||
|
** Licensees holding valid commercial Qt licenses may use this file in
|
||||||
|
** accordance with the commercial license agreement provided with the
|
||||||
|
** Software or, alternatively, in accordance with the terms contained in
|
||||||
|
** a written agreement between you and The Qt Company. For licensing terms
|
||||||
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||||
|
** information use the contact form at https://www.qt.io/contact-us.
|
||||||
|
**
|
||||||
|
** GNU General Public License Usage
|
||||||
|
** Alternatively, this file may be used under the terms of the GNU
|
||||||
|
** General Public License version 3 as published by the Free Software
|
||||||
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
||||||
|
** included in the packaging of this file. Please review the following
|
||||||
|
** information to ensure the GNU General Public License requirements will
|
||||||
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
||||||
|
**
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#include "temporarydirectory.h"
|
||||||
|
|
||||||
|
#include "qtcassert.h"
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
|
namespace Utils {
|
||||||
|
|
||||||
|
static std::unique_ptr<QTemporaryDir> m_masterTemporaryDir;
|
||||||
|
|
||||||
|
TemporaryDirectory::TemporaryDirectory(const QString &pattern) :
|
||||||
|
QTemporaryDir(m_masterTemporaryDir->path() + '/' + pattern)
|
||||||
|
{
|
||||||
|
QTC_CHECK(!QFileInfo(pattern).isAbsolute());
|
||||||
|
}
|
||||||
|
|
||||||
|
QTemporaryDir *TemporaryDirectory::masterTemporaryDirectory()
|
||||||
|
{
|
||||||
|
return m_masterTemporaryDir.get();
|
||||||
|
}
|
||||||
|
|
||||||
|
void TemporaryDirectory::setMasterTemporaryDirectory(const QString &pattern)
|
||||||
|
{
|
||||||
|
m_masterTemporaryDir = std::make_unique<QTemporaryDir>(pattern);
|
||||||
|
}
|
||||||
|
|
||||||
|
QString TemporaryDirectory::masterDirectoryPath()
|
||||||
|
{
|
||||||
|
return m_masterTemporaryDir->path();
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace Utils
|
||||||
44
src/libs/utils/temporarydirectory.h
Normal file
44
src/libs/utils/temporarydirectory.h
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** Copyright (C) 2016 The Qt Company Ltd.
|
||||||
|
** Contact: https://www.qt.io/licensing/
|
||||||
|
**
|
||||||
|
** This file is part of Qt Creator.
|
||||||
|
**
|
||||||
|
** Commercial License Usage
|
||||||
|
** Licensees holding valid commercial Qt licenses may use this file in
|
||||||
|
** accordance with the commercial license agreement provided with the
|
||||||
|
** Software or, alternatively, in accordance with the terms contained in
|
||||||
|
** a written agreement between you and The Qt Company. For licensing terms
|
||||||
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||||
|
** information use the contact form at https://www.qt.io/contact-us.
|
||||||
|
**
|
||||||
|
** GNU General Public License Usage
|
||||||
|
** Alternatively, this file may be used under the terms of the GNU
|
||||||
|
** General Public License version 3 as published by the Free Software
|
||||||
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
||||||
|
** included in the packaging of this file. Please review the following
|
||||||
|
** information to ensure the GNU General Public License requirements will
|
||||||
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
||||||
|
**
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "utils_global.h"
|
||||||
|
|
||||||
|
#include <QTemporaryDir>
|
||||||
|
|
||||||
|
namespace Utils {
|
||||||
|
|
||||||
|
class QTCREATOR_UTILS_EXPORT TemporaryDirectory : public QTemporaryDir
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
explicit TemporaryDirectory(const QString &pattern);
|
||||||
|
|
||||||
|
static QTemporaryDir *masterTemporaryDirectory();
|
||||||
|
static void setMasterTemporaryDirectory(const QString &pattern);
|
||||||
|
static QString masterDirectoryPath();
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace Utils
|
||||||
39
src/libs/utils/temporaryfile.cpp
Normal file
39
src/libs/utils/temporaryfile.cpp
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** Copyright (C) 2016 The Qt Company Ltd.
|
||||||
|
** Contact: https://www.qt.io/licensing/
|
||||||
|
**
|
||||||
|
** This file is part of Qt Creator.
|
||||||
|
**
|
||||||
|
** Commercial License Usage
|
||||||
|
** Licensees holding valid commercial Qt licenses may use this file in
|
||||||
|
** accordance with the commercial license agreement provided with the
|
||||||
|
** Software or, alternatively, in accordance with the terms contained in
|
||||||
|
** a written agreement between you and The Qt Company. For licensing terms
|
||||||
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||||
|
** information use the contact form at https://www.qt.io/contact-us.
|
||||||
|
**
|
||||||
|
** GNU General Public License Usage
|
||||||
|
** Alternatively, this file may be used under the terms of the GNU
|
||||||
|
** General Public License version 3 as published by the Free Software
|
||||||
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
||||||
|
** included in the packaging of this file. Please review the following
|
||||||
|
** information to ensure the GNU General Public License requirements will
|
||||||
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
||||||
|
**
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#include "temporaryfile.h"
|
||||||
|
|
||||||
|
#include "temporarydirectory.h"
|
||||||
|
#include "qtcassert.h"
|
||||||
|
|
||||||
|
namespace Utils {
|
||||||
|
|
||||||
|
TemporaryFile::TemporaryFile(const QString &pattern) :
|
||||||
|
QTemporaryFile(TemporaryDirectory::masterTemporaryDirectory()->path() + '/' + pattern)
|
||||||
|
{
|
||||||
|
QTC_CHECK(!QFileInfo(pattern).isAbsolute());
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace Utils
|
||||||
40
src/libs/utils/temporaryfile.h
Normal file
40
src/libs/utils/temporaryfile.h
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** Copyright (C) 2016 The Qt Company Ltd.
|
||||||
|
** Contact: https://www.qt.io/licensing/
|
||||||
|
**
|
||||||
|
** This file is part of Qt Creator.
|
||||||
|
**
|
||||||
|
** Commercial License Usage
|
||||||
|
** Licensees holding valid commercial Qt licenses may use this file in
|
||||||
|
** accordance with the commercial license agreement provided with the
|
||||||
|
** Software or, alternatively, in accordance with the terms contained in
|
||||||
|
** a written agreement between you and The Qt Company. For licensing terms
|
||||||
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||||
|
** information use the contact form at https://www.qt.io/contact-us.
|
||||||
|
**
|
||||||
|
** GNU General Public License Usage
|
||||||
|
** Alternatively, this file may be used under the terms of the GNU
|
||||||
|
** General Public License version 3 as published by the Free Software
|
||||||
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
||||||
|
** included in the packaging of this file. Please review the following
|
||||||
|
** information to ensure the GNU General Public License requirements will
|
||||||
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
||||||
|
**
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "utils_global.h"
|
||||||
|
|
||||||
|
#include <QTemporaryFile>
|
||||||
|
|
||||||
|
namespace Utils {
|
||||||
|
|
||||||
|
class QTCREATOR_UTILS_EXPORT TemporaryFile : public QTemporaryFile
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
explicit TemporaryFile(const QString &pattern);
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace Utils
|
||||||
@@ -31,6 +31,8 @@ SOURCES += $$PWD/environment.cpp \
|
|||||||
$$PWD/settingsselector.cpp \
|
$$PWD/settingsselector.cpp \
|
||||||
$$PWD/stringutils.cpp \
|
$$PWD/stringutils.cpp \
|
||||||
$$PWD/templateengine.cpp \
|
$$PWD/templateengine.cpp \
|
||||||
|
$$PWD/temporarydirectory.cpp \
|
||||||
|
$$PWD/temporaryfile.cpp \
|
||||||
$$PWD/textfieldcheckbox.cpp \
|
$$PWD/textfieldcheckbox.cpp \
|
||||||
$$PWD/textfieldcombobox.cpp \
|
$$PWD/textfieldcombobox.cpp \
|
||||||
$$PWD/filesearch.cpp \
|
$$PWD/filesearch.cpp \
|
||||||
@@ -128,6 +130,8 @@ HEADERS += \
|
|||||||
$$PWD/shellcommandpage.h \
|
$$PWD/shellcommandpage.h \
|
||||||
$$PWD/stringutils.h \
|
$$PWD/stringutils.h \
|
||||||
$$PWD/templateengine.h \
|
$$PWD/templateengine.h \
|
||||||
|
$$PWD/temporarydirectory.h \
|
||||||
|
$$PWD/temporaryfile.h \
|
||||||
$$PWD/textfieldcheckbox.h \
|
$$PWD/textfieldcheckbox.h \
|
||||||
$$PWD/textfieldcombobox.h \
|
$$PWD/textfieldcombobox.h \
|
||||||
$$PWD/filesearch.h \
|
$$PWD/filesearch.h \
|
||||||
|
|||||||
@@ -214,6 +214,10 @@ Project {
|
|||||||
"synchronousprocess.h",
|
"synchronousprocess.h",
|
||||||
"templateengine.cpp",
|
"templateengine.cpp",
|
||||||
"templateengine.h",
|
"templateengine.h",
|
||||||
|
"temporarydirectory.cpp",
|
||||||
|
"temporarydirectory.h",
|
||||||
|
"temporaryfile.cpp",
|
||||||
|
"temporaryfile.h",
|
||||||
"textfieldcheckbox.cpp",
|
"textfieldcheckbox.cpp",
|
||||||
"textfieldcheckbox.h",
|
"textfieldcheckbox.h",
|
||||||
"textfieldcombobox.cpp",
|
"textfieldcombobox.cpp",
|
||||||
|
|||||||
@@ -41,13 +41,13 @@
|
|||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
#include <utils/runextensions.h>
|
#include <utils/runextensions.h>
|
||||||
#include <utils/synchronousprocess.h>
|
#include <utils/synchronousprocess.h>
|
||||||
|
#include <utils/temporaryfile.h>
|
||||||
|
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QTime>
|
#include <QTime>
|
||||||
#include <QTemporaryFile>
|
|
||||||
#include <QTcpServer>
|
#include <QTcpServer>
|
||||||
#include <QTcpSocket>
|
#include <QTcpSocket>
|
||||||
|
|
||||||
@@ -495,7 +495,7 @@ void AndroidRunnerWorker::asyncStart(const QString &intentName,
|
|||||||
} else {
|
} else {
|
||||||
// Handling ping.
|
// Handling ping.
|
||||||
for (int i = 0; ; ++i) {
|
for (int i = 0; ; ++i) {
|
||||||
QTemporaryFile tmp(QDir::tempPath() + "/pingpong");
|
Utils::TemporaryFile tmp("pingpong");
|
||||||
tmp.open();
|
tmp.open();
|
||||||
tmp.close();
|
tmp.close();
|
||||||
|
|
||||||
@@ -563,7 +563,7 @@ void AndroidRunnerWorker::handleRemoteDebuggerRunning()
|
|||||||
m_socket->waitForBytesWritten();
|
m_socket->waitForBytesWritten();
|
||||||
m_socket->close();
|
m_socket->close();
|
||||||
} else {
|
} else {
|
||||||
QTemporaryFile tmp(QDir::tempPath() + "/pingpong");
|
Utils::TemporaryFile tmp("pingpong");
|
||||||
tmp.open();
|
tmp.open();
|
||||||
|
|
||||||
runAdb(selector() << "push" << tmp.fileName() << m_pongFile);
|
runAdb(selector() << "push" << tmp.fileName() << m_pongFile);
|
||||||
|
|||||||
@@ -26,7 +26,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QTemporaryDir>
|
|
||||||
|
|
||||||
namespace CppTools { namespace Tests { class TemporaryCopiedDir; } }
|
namespace CppTools { namespace Tests { class TemporaryCopiedDir; } }
|
||||||
|
|
||||||
|
|||||||
@@ -56,6 +56,7 @@
|
|||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
#include <utils/runextensions.h>
|
#include <utils/runextensions.h>
|
||||||
#include <utils/synchronousprocess.h>
|
#include <utils/synchronousprocess.h>
|
||||||
|
#include <utils/temporarydirectory.h>
|
||||||
|
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
@@ -84,7 +85,8 @@ FormatTask format(FormatTask task)
|
|||||||
case Command::FileProcessing: {
|
case Command::FileProcessing: {
|
||||||
// Save text to temporary file
|
// Save text to temporary file
|
||||||
const QFileInfo fi(task.filePath);
|
const QFileInfo fi(task.filePath);
|
||||||
Utils::TempFileSaver sourceFile(QDir::tempPath() + "/qtc_beautifier_XXXXXXXX."
|
Utils::TempFileSaver sourceFile(Utils::TemporaryDirectory::masterDirectoryPath()
|
||||||
|
+ "/qtc_beautifier_XXXXXXXX."
|
||||||
+ fi.suffix());
|
+ fi.suffix());
|
||||||
sourceFile.setAutoRemove(true);
|
sourceFile.setAutoRemove(true);
|
||||||
sourceFile.write(task.sourceData.toUtf8());
|
sourceFile.write(task.sourceData.toUtf8());
|
||||||
|
|||||||
@@ -33,8 +33,7 @@
|
|||||||
namespace ClangCodeModel {
|
namespace ClangCodeModel {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
UiHeaderOnDiskManager::UiHeaderOnDiskManager()
|
UiHeaderOnDiskManager::UiHeaderOnDiskManager() : m_temporaryDir("/qtc-clang-uiheader-XXXXXX")
|
||||||
: m_temporaryDir(QDir::tempPath() + QStringLiteral("/qtc-clang-uiheader-XXXXXX"))
|
|
||||||
{
|
{
|
||||||
QTC_CHECK(m_temporaryDir.isValid());
|
QTC_CHECK(m_temporaryDir.isValid());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,7 +26,6 @@
|
|||||||
#include "refactoringconnectionclient.h"
|
#include "refactoringconnectionclient.h"
|
||||||
|
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
#include <QTemporaryDir>
|
|
||||||
|
|
||||||
namespace ClangBackEnd {
|
namespace ClangBackEnd {
|
||||||
|
|
||||||
|
|||||||
@@ -55,9 +55,9 @@
|
|||||||
|
|
||||||
#include <utils/algorithm.h>
|
#include <utils/algorithm.h>
|
||||||
#include <utils/hostosinfo.h>
|
#include <utils/hostosinfo.h>
|
||||||
|
#include <utils/temporarydirectory.h>
|
||||||
|
|
||||||
#include <QLoggingCategory>
|
#include <QLoggingCategory>
|
||||||
#include <QTemporaryDir>
|
|
||||||
|
|
||||||
using namespace CppTools;
|
using namespace CppTools;
|
||||||
using namespace ProjectExplorer;
|
using namespace ProjectExplorer;
|
||||||
@@ -513,7 +513,7 @@ void ClangStaticAnalyzerRunControl::start()
|
|||||||
m_clangExecutable = executable;
|
m_clangExecutable = executable;
|
||||||
|
|
||||||
// Create log dir
|
// Create log dir
|
||||||
QTemporaryDir temporaryDir(QDir::tempPath() + QLatin1String("/qtc-clangstaticanalyzer-XXXXXX"));
|
Utils::TemporaryDirectory temporaryDir("qtc-clangstaticanalyzer-XXXXXX");
|
||||||
temporaryDir.setAutoRemove(false);
|
temporaryDir.setAutoRemove(false);
|
||||||
if (!temporaryDir.isValid()) {
|
if (!temporaryDir.isValid()) {
|
||||||
const QString errorMessage
|
const QString errorMessage
|
||||||
|
|||||||
@@ -29,12 +29,12 @@
|
|||||||
|
|
||||||
#include <utils/qtcprocess.h>
|
#include <utils/qtcprocess.h>
|
||||||
#include <utils/synchronousprocess.h>
|
#include <utils/synchronousprocess.h>
|
||||||
|
#include <utils/temporaryfile.h>
|
||||||
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
#include <QLoggingCategory>
|
#include <QLoggingCategory>
|
||||||
#include <QTemporaryFile>
|
|
||||||
|
|
||||||
static Q_LOGGING_CATEGORY(LOG, "qtc.clangstaticanalyzer.runner")
|
static Q_LOGGING_CATEGORY(LOG, "qtc.clangstaticanalyzer.runner")
|
||||||
|
|
||||||
@@ -165,7 +165,7 @@ QString ClangStaticAnalyzerRunner::createLogFile(const QString &filePath) const
|
|||||||
const QString fileTemplate = m_clangLogFileDir
|
const QString fileTemplate = m_clangLogFileDir
|
||||||
+ QLatin1String("/report-") + fileName + QLatin1String("-XXXXXX.plist");
|
+ QLatin1String("/report-") + fileName + QLatin1String("-XXXXXX.plist");
|
||||||
|
|
||||||
QTemporaryFile temporaryFile;
|
Utils::TemporaryFile temporaryFile("clangstaticanalyzer");
|
||||||
temporaryFile.setAutoRemove(false);
|
temporaryFile.setAutoRemove(false);
|
||||||
temporaryFile.setFileTemplate(fileTemplate);
|
temporaryFile.setFileTemplate(fileTemplate);
|
||||||
if (temporaryFile.open()) {
|
if (temporaryFile.open()) {
|
||||||
|
|||||||
@@ -39,7 +39,6 @@
|
|||||||
|
|
||||||
#include <QEventLoop>
|
#include <QEventLoop>
|
||||||
#include <QSignalSpy>
|
#include <QSignalSpy>
|
||||||
#include <QTemporaryDir>
|
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
#include <QtTest>
|
#include <QtTest>
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QTemporaryDir>
|
|
||||||
|
|
||||||
namespace CppTools { namespace Tests { class TemporaryCopiedDir; } }
|
namespace CppTools { namespace Tests { class TemporaryCopiedDir; } }
|
||||||
|
|
||||||
|
|||||||
@@ -56,6 +56,7 @@
|
|||||||
#include <utils/algorithm.h>
|
#include <utils/algorithm.h>
|
||||||
#include <utils/mimetypes/mimedatabase.h>
|
#include <utils/mimetypes/mimedatabase.h>
|
||||||
#include <utils/synchronousprocess.h>
|
#include <utils/synchronousprocess.h>
|
||||||
|
#include <utils/temporarydirectory.h>
|
||||||
#include <utils/parameteraction.h>
|
#include <utils/parameteraction.h>
|
||||||
#include <utils/fileutils.h>
|
#include <utils/fileutils.h>
|
||||||
#include <utils/hostosinfo.h>
|
#include <utils/hostosinfo.h>
|
||||||
@@ -85,7 +86,6 @@
|
|||||||
#include <QProcess>
|
#include <QProcess>
|
||||||
#include <QRegExp>
|
#include <QRegExp>
|
||||||
#include <QSharedPointer>
|
#include <QSharedPointer>
|
||||||
#include <QTemporaryFile>
|
|
||||||
#include <QTextCodec>
|
#include <QTextCodec>
|
||||||
#include <QtPlugin>
|
#include <QtPlugin>
|
||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
@@ -1119,8 +1119,8 @@ void ClearCasePlugin::diffActivity()
|
|||||||
diffGraphical(pair.first, pair.second);
|
diffGraphical(pair.first, pair.second);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
rmdir(QDir::tempPath() + QLatin1String("/ccdiff/") + activity);
|
rmdir(Utils::TemporaryDirectory::masterDirectoryPath() + QLatin1String("/ccdiff/") + activity);
|
||||||
QDir(QDir::tempPath()).rmpath(QLatin1String("ccdiff/") + activity);
|
QDir(Utils::TemporaryDirectory::masterDirectoryPath()).rmpath(QLatin1String("ccdiff/") + activity);
|
||||||
m_diffPrefix = activity;
|
m_diffPrefix = activity;
|
||||||
const FileVerIt fend = filever.end();
|
const FileVerIt fend = filever.end();
|
||||||
for (FileVerIt it = filever.begin(); it != fend; ++it) {
|
for (FileVerIt it = filever.begin(); it != fend; ++it) {
|
||||||
|
|||||||
@@ -55,6 +55,7 @@
|
|||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
#include <utils/qtcprocess.h>
|
#include <utils/qtcprocess.h>
|
||||||
#include <utils/synchronousprocess.h>
|
#include <utils/synchronousprocess.h>
|
||||||
|
#include <utils/temporarydirectory.h>
|
||||||
|
|
||||||
#include <QDateTime>
|
#include <QDateTime>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
@@ -62,7 +63,6 @@
|
|||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QRegularExpression>
|
#include <QRegularExpression>
|
||||||
#include <QSet>
|
#include <QSet>
|
||||||
#include <QTemporaryDir>
|
|
||||||
|
|
||||||
using namespace ProjectExplorer;
|
using namespace ProjectExplorer;
|
||||||
|
|
||||||
@@ -91,10 +91,9 @@ const Utils::FileName BuildDirManager::workDirectory() const
|
|||||||
if (bdir.exists())
|
if (bdir.exists())
|
||||||
return bdir;
|
return bdir;
|
||||||
if (!m_tempDir) {
|
if (!m_tempDir) {
|
||||||
const QString path = QDir::tempPath() + QLatin1String("/qtc-cmake-XXXXXX");
|
m_tempDir.reset(new Utils::TemporaryDirectory("qtc-cmake-XXXXXXXX"));
|
||||||
m_tempDir.reset(new QTemporaryDir(path));
|
|
||||||
if (!m_tempDir->isValid())
|
if (!m_tempDir->isValid())
|
||||||
emit errorOccured(tr("Failed to create temporary directory using template \"%1\".").arg(path));
|
emit errorOccured(tr("Failed to create temporary directory \"%1\".").arg(m_tempDir->path()));
|
||||||
}
|
}
|
||||||
return Utils::FileName::fromString(m_tempDir->path());
|
return Utils::FileName::fromString(m_tempDir->path());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,9 +29,9 @@
|
|||||||
#include "cmakeconfigitem.h"
|
#include "cmakeconfigitem.h"
|
||||||
|
|
||||||
#include <utils/fileutils.h>
|
#include <utils/fileutils.h>
|
||||||
|
#include <utils/temporarydirectory.h>
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QTemporaryDir>
|
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
|
|
||||||
#include <functional>
|
#include <functional>
|
||||||
@@ -104,7 +104,7 @@ private:
|
|||||||
void becameDirty();
|
void becameDirty();
|
||||||
|
|
||||||
CMakeBuildConfiguration *m_buildConfiguration = nullptr;
|
CMakeBuildConfiguration *m_buildConfiguration = nullptr;
|
||||||
mutable std::unique_ptr<QTemporaryDir> m_tempDir = nullptr;
|
mutable std::unique_ptr<Utils::TemporaryDirectory> m_tempDir = nullptr;
|
||||||
mutable CMakeConfig m_cmakeCache;
|
mutable CMakeConfig m_cmakeCache;
|
||||||
|
|
||||||
QTimer m_reparseTimer;
|
QTimer m_reparseTimer;
|
||||||
|
|||||||
@@ -33,6 +33,7 @@
|
|||||||
|
|
||||||
#include <QByteArray>
|
#include <QByteArray>
|
||||||
#include <QCryptographicHash>
|
#include <QCryptographicHash>
|
||||||
|
#include <QFile>
|
||||||
#include <QJsonDocument>
|
#include <QJsonDocument>
|
||||||
#include <QJsonObject>
|
#include <QJsonObject>
|
||||||
#include <QLocalSocket>
|
#include <QLocalSocket>
|
||||||
|
|||||||
@@ -28,7 +28,6 @@
|
|||||||
#include <utils/qtcprocess.h>
|
#include <utils/qtcprocess.h>
|
||||||
|
|
||||||
#include <QLoggingCategory>
|
#include <QLoggingCategory>
|
||||||
#include <QTemporaryDir>
|
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
#include <QVariantMap>
|
#include <QVariantMap>
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,6 @@
|
|||||||
#include <utils/qtcprocess.h>
|
#include <utils/qtcprocess.h>
|
||||||
|
|
||||||
#include <QSet>
|
#include <QSet>
|
||||||
#include <QTemporaryDir>
|
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|||||||
@@ -46,12 +46,12 @@
|
|||||||
#include <utils/fileutils.h>
|
#include <utils/fileutils.h>
|
||||||
#include <utils/mimetypes/mimedatabase.h>
|
#include <utils/mimetypes/mimedatabase.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
#include <utils/temporarydirectory.h>
|
||||||
#include <texteditor/texteditor.h>
|
#include <texteditor/texteditor.h>
|
||||||
#include <texteditor/textdocument.h>
|
#include <texteditor/textdocument.h>
|
||||||
|
|
||||||
#include <QtPlugin>
|
#include <QtPlugin>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QDir>
|
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QClipboard>
|
#include <QClipboard>
|
||||||
@@ -335,7 +335,7 @@ static inline QString filePrefixFromTitle(const QString &title)
|
|||||||
static inline QString tempFilePattern(const QString &prefix, const QString &extension)
|
static inline QString tempFilePattern(const QString &prefix, const QString &extension)
|
||||||
{
|
{
|
||||||
// Get directory
|
// Get directory
|
||||||
QString pattern = QDir::tempPath();
|
QString pattern = Utils::TemporaryDirectory::masterDirectoryPath();
|
||||||
const QChar slash = QLatin1Char('/');
|
const QChar slash = QLatin1Char('/');
|
||||||
if (!pattern.endsWith(slash))
|
if (!pattern.endsWith(slash))
|
||||||
pattern.append(slash);
|
pattern.append(slash);
|
||||||
|
|||||||
@@ -28,7 +28,8 @@
|
|||||||
|
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
|
|
||||||
#include <QDir>
|
#include <utils/temporarydirectory.h>
|
||||||
|
|
||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
|
|
||||||
@@ -39,7 +40,7 @@ static const char displayCountKeyC[] = "DisplayCount";
|
|||||||
namespace CodePaster {
|
namespace CodePaster {
|
||||||
|
|
||||||
FileShareProtocolSettings::FileShareProtocolSettings() :
|
FileShareProtocolSettings::FileShareProtocolSettings() :
|
||||||
path(QDir::tempPath()), displayCount(10)
|
path(Utils::TemporaryDirectory::masterDirectoryPath()), displayCount(10)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -42,9 +42,9 @@
|
|||||||
#include <cplusplus/LookupContext.h>
|
#include <cplusplus/LookupContext.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
#include <utils/runextensions.h>
|
#include <utils/runextensions.h>
|
||||||
|
#include <utils/temporarydirectory.h>
|
||||||
|
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
#include <QDir>
|
|
||||||
#include <QElapsedTimer>
|
#include <QElapsedTimer>
|
||||||
#include <QRegularExpression>
|
#include <QRegularExpression>
|
||||||
|
|
||||||
@@ -72,10 +72,9 @@ public:
|
|||||||
WriteTaskFileForDiagnostics()
|
WriteTaskFileForDiagnostics()
|
||||||
: m_processedDiagnostics(0)
|
: m_processedDiagnostics(0)
|
||||||
{
|
{
|
||||||
const QString fileName = QDir::tempPath()
|
const QString fileName = Utils::TemporaryDirectory::masterDirectoryPath()
|
||||||
+ QLatin1String("/qtc_findErrorsIndexing.diagnostics.")
|
+ "/qtc_findErrorsIndexing.diagnostics."
|
||||||
+ QDateTime::currentDateTime().toString(QLatin1String("yyMMdd_HHmm"))
|
+ QDateTime::currentDateTime().toString("yyMMdd_HHmm") + ".tasks";
|
||||||
+ QLatin1String(".tasks");
|
|
||||||
|
|
||||||
m_file.setFileName(fileName);
|
m_file.setFileName(fileName);
|
||||||
Q_ASSERT(m_file.open(QIODevice::WriteOnly | QIODevice::Text));
|
Q_ASSERT(m_file.open(QIODevice::WriteOnly | QIODevice::Text));
|
||||||
|
|||||||
@@ -29,10 +29,10 @@
|
|||||||
|
|
||||||
#include <utils/fileutils.h>
|
#include <utils/fileutils.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
#include <utils/temporarydirectory.h>
|
||||||
|
|
||||||
#include <QtTest>
|
#include <QtTest>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QDir>
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Tests for various parts of the code generation. Well, okay, currently it only
|
Tests for various parts of the code generation. Well, okay, currently it only
|
||||||
@@ -527,7 +527,7 @@ void CppToolsPlugin::test_codegen_definition_middle_member()
|
|||||||
"\n"
|
"\n"
|
||||||
"}\n"
|
"}\n"
|
||||||
"\n"
|
"\n"
|
||||||
"int y;\n").arg(QDir::tempPath()).toLatin1();
|
"int y;\n").arg(Utils::TemporaryDirectory::masterDirectoryPath()).toLatin1();
|
||||||
|
|
||||||
Document::Ptr sourceDocument = createDocumentAndFile(&temporaryDir, "file.cpp", sourceText, 4U);
|
Document::Ptr sourceDocument = createDocumentAndFile(&temporaryDir, "file.cpp", sourceText, 4U);
|
||||||
QVERIFY(sourceDocument);
|
QVERIFY(sourceDocument);
|
||||||
|
|||||||
@@ -33,6 +33,7 @@
|
|||||||
#include <cpptools/cppprojectfile.h>
|
#include <cpptools/cppprojectfile.h>
|
||||||
#include <projectexplorer/project.h>
|
#include <projectexplorer/project.h>
|
||||||
#include <utils/algorithm.h>
|
#include <utils/algorithm.h>
|
||||||
|
#include <utils/temporarydirectory.h>
|
||||||
|
|
||||||
#include <cplusplus/CppDocument.h>
|
#include <cplusplus/CppDocument.h>
|
||||||
#include <cplusplus/Token.h>
|
#include <cplusplus/Token.h>
|
||||||
@@ -445,9 +446,10 @@ Dumper::Dumper(const CPlusPlus::Snapshot &globalSnapshot, const QString &logFile
|
|||||||
QString logFileId_ = logFileId;
|
QString logFileId_ = logFileId;
|
||||||
if (!logFileId_.isEmpty())
|
if (!logFileId_.isEmpty())
|
||||||
logFileId_.prepend(QLatin1Char('_'));
|
logFileId_.prepend(QLatin1Char('_'));
|
||||||
const QString logFileName = QDir::tempPath() + QString::fromLatin1("/qtc-codemodelinspection")
|
const QString logFileName = ::Utils::TemporaryDirectory::masterDirectoryPath()
|
||||||
|
+ "/qtc-codemodelinspection"
|
||||||
+ ideRevision_
|
+ ideRevision_
|
||||||
+ QDateTime::currentDateTime().toString(QLatin1String("_yyMMdd_hhmmss"))
|
+ QDateTime::currentDateTime().toString("_yyMMdd_hhmmss")
|
||||||
+ logFileId_
|
+ logFileId_
|
||||||
+ QLatin1String(".txt");
|
+ QLatin1String(".txt");
|
||||||
|
|
||||||
|
|||||||
@@ -29,6 +29,7 @@
|
|||||||
#include "cppfilesettingspage.h"
|
#include "cppfilesettingspage.h"
|
||||||
|
|
||||||
#include <utils/fileutils.h>
|
#include <utils/fileutils.h>
|
||||||
|
#include <utils/temporarydirectory.h>
|
||||||
|
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QtTest>
|
#include <QtTest>
|
||||||
@@ -45,7 +46,7 @@ static void createTempFile(const QString &fileName)
|
|||||||
|
|
||||||
static QString baseTestDir()
|
static QString baseTestDir()
|
||||||
{
|
{
|
||||||
return QDir::tempPath() + _("/qtc_cppheadersource/");
|
return Utils::TemporaryDirectory::masterDirectoryPath() + "/qtc_cppheadersource/";
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace CppTools {
|
namespace CppTools {
|
||||||
|
|||||||
@@ -43,6 +43,7 @@
|
|||||||
#include <cplusplus/CppDocument.h>
|
#include <cplusplus/CppDocument.h>
|
||||||
#include <utils/executeondestruction.h>
|
#include <utils/executeondestruction.h>
|
||||||
#include <utils/fileutils.h>
|
#include <utils/fileutils.h>
|
||||||
|
#include <utils/temporarydirectory.h>
|
||||||
|
|
||||||
#include <QtTest>
|
#include <QtTest>
|
||||||
|
|
||||||
@@ -83,7 +84,7 @@ QString TestDocument::filePath() const
|
|||||||
return QDir::cleanPath(m_baseDirectory + QLatin1Char('/') + m_fileName);
|
return QDir::cleanPath(m_baseDirectory + QLatin1Char('/') + m_fileName);
|
||||||
|
|
||||||
if (!QFileInfo(m_fileName).isAbsolute())
|
if (!QFileInfo(m_fileName).isAbsolute())
|
||||||
return QDir::tempPath() + QLatin1Char('/') + m_fileName;
|
return Utils::TemporaryDirectory::masterDirectoryPath() + '/' + m_fileName;
|
||||||
|
|
||||||
return m_fileName;
|
return m_fileName;
|
||||||
}
|
}
|
||||||
@@ -301,8 +302,8 @@ ProjectInfo ProjectOpenerAndCloser::open(const QString &projectFile, bool config
|
|||||||
}
|
}
|
||||||
|
|
||||||
TemporaryDir::TemporaryDir()
|
TemporaryDir::TemporaryDir()
|
||||||
: m_temporaryDir(QFileInfo(QDir::tempPath()).canonicalFilePath()
|
: m_temporaryDir(QFileInfo(Utils::TemporaryDirectory::masterDirectoryPath()).canonicalFilePath()
|
||||||
+ QLatin1String("/qtcreator-tests-XXXXXX"))
|
+ "/qtcreator-tests-XXXXXX")
|
||||||
, m_isValid(m_temporaryDir.isValid())
|
, m_isValid(m_temporaryDir.isValid())
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,9 +28,9 @@
|
|||||||
#include "cpptools_global.h"
|
#include "cpptools_global.h"
|
||||||
|
|
||||||
#include <cplusplus/CppDocument.h>
|
#include <cplusplus/CppDocument.h>
|
||||||
|
#include <utils/temporarydirectory.h>
|
||||||
|
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
#include <QTemporaryDir>
|
|
||||||
|
|
||||||
namespace CPlusPlus {
|
namespace CPlusPlus {
|
||||||
class Document;
|
class Document;
|
||||||
@@ -138,7 +138,7 @@ public:
|
|||||||
QString createFile(const QByteArray &relativePath, const QByteArray &contents);
|
QString createFile(const QByteArray &relativePath, const QByteArray &contents);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
QTemporaryDir m_temporaryDir;
|
Utils::TemporaryDirectory m_temporaryDir;
|
||||||
bool m_isValid;
|
bool m_isValid;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -2743,7 +2743,7 @@ void DebuggerPluginPrivate::updateDebugWithoutDeployMenu()
|
|||||||
void DebuggerPluginPrivate::dumpLog()
|
void DebuggerPluginPrivate::dumpLog()
|
||||||
{
|
{
|
||||||
QString fileName = QFileDialog::getSaveFileName(ICore::mainWindow(),
|
QString fileName = QFileDialog::getSaveFileName(ICore::mainWindow(),
|
||||||
tr("Save Debugger Log"), QDir::tempPath());
|
tr("Save Debugger Log"), Utils::TemporaryDirectory::masterDirectoryPath());
|
||||||
if (fileName.isEmpty())
|
if (fileName.isEmpty())
|
||||||
return;
|
return;
|
||||||
FileSaver saver(fileName);
|
FileSaver saver(fileName);
|
||||||
|
|||||||
@@ -34,9 +34,10 @@
|
|||||||
#include <utils/fileutils.h>
|
#include <utils/fileutils.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
#include <utils/synchronousprocess.h>
|
#include <utils/synchronousprocess.h>
|
||||||
|
#include <utils/temporarydirectory.h>
|
||||||
|
#include <utils/temporaryfile.h>
|
||||||
|
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QTemporaryFile>
|
|
||||||
|
|
||||||
using namespace Utils;
|
using namespace Utils;
|
||||||
using namespace ProjectExplorer;
|
using namespace ProjectExplorer;
|
||||||
@@ -277,8 +278,7 @@ void GdbCoreEngine::shutdownEngine()
|
|||||||
|
|
||||||
static QString tempCoreFilename()
|
static QString tempCoreFilename()
|
||||||
{
|
{
|
||||||
QString pattern = QDir::tempPath() + QLatin1String("/tmpcore-XXXXXX");
|
Utils::TemporaryFile tmp("tmpcore-XXXXXX");
|
||||||
QTemporaryFile tmp(pattern);
|
|
||||||
tmp.open();
|
tmp.open();
|
||||||
return tmp.fileName();
|
return tmp.fileName();
|
||||||
}
|
}
|
||||||
@@ -292,7 +292,7 @@ void GdbCoreEngine::unpackCoreIfNeeded()
|
|||||||
showMessage(msg.arg(m_tempCoreName));
|
showMessage(msg.arg(m_tempCoreName));
|
||||||
arguments << QLatin1String("-o") << m_tempCoreName << QLatin1String("-x") << m_coreName;
|
arguments << QLatin1String("-o") << m_tempCoreName << QLatin1String("-x") << m_coreName;
|
||||||
m_coreUnpackProcess = new QProcess(this);
|
m_coreUnpackProcess = new QProcess(this);
|
||||||
m_coreUnpackProcess->setWorkingDirectory(QDir::tempPath());
|
m_coreUnpackProcess->setWorkingDirectory(Utils::TemporaryDirectory::masterDirectoryPath());
|
||||||
m_coreUnpackProcess->start(QLatin1String("lzop"), arguments);
|
m_coreUnpackProcess->start(QLatin1String("lzop"), arguments);
|
||||||
connect(m_coreUnpackProcess, static_cast<void (QProcess::*)(int)>(&QProcess::finished),
|
connect(m_coreUnpackProcess, static_cast<void (QProcess::*)(int)>(&QProcess::finished),
|
||||||
this, &GdbCoreEngine::continueSetupEngine);
|
this, &GdbCoreEngine::continueSetupEngine);
|
||||||
@@ -303,7 +303,7 @@ void GdbCoreEngine::unpackCoreIfNeeded()
|
|||||||
m_tempCoreFile.open(QFile::WriteOnly);
|
m_tempCoreFile.open(QFile::WriteOnly);
|
||||||
arguments << QLatin1String("-c") << QLatin1String("-d") << m_coreName;
|
arguments << QLatin1String("-c") << QLatin1String("-d") << m_coreName;
|
||||||
m_coreUnpackProcess = new QProcess(this);
|
m_coreUnpackProcess = new QProcess(this);
|
||||||
m_coreUnpackProcess->setWorkingDirectory(QDir::tempPath());
|
m_coreUnpackProcess->setWorkingDirectory(Utils::TemporaryDirectory::masterDirectoryPath());
|
||||||
m_coreUnpackProcess->start(QLatin1String("gzip"), arguments);
|
m_coreUnpackProcess->start(QLatin1String("gzip"), arguments);
|
||||||
connect(m_coreUnpackProcess, &QProcess::readyRead, this, &GdbCoreEngine::writeCoreChunk);
|
connect(m_coreUnpackProcess, &QProcess::readyRead, this, &GdbCoreEngine::writeCoreChunk);
|
||||||
connect(m_coreUnpackProcess, static_cast<void (QProcess::*)(int)>(&QProcess::finished),
|
connect(m_coreUnpackProcess, static_cast<void (QProcess::*)(int)>(&QProcess::finished),
|
||||||
|
|||||||
@@ -71,13 +71,13 @@
|
|||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
#include <utils/qtcprocess.h>
|
#include <utils/qtcprocess.h>
|
||||||
#include <utils/savedaction.h>
|
#include <utils/savedaction.h>
|
||||||
|
#include <utils/temporaryfile.h>
|
||||||
|
|
||||||
#include <QBuffer>
|
#include <QBuffer>
|
||||||
#include <QDirIterator>
|
#include <QDirIterator>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QProcess>
|
#include <QProcess>
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
#include <QTemporaryFile>
|
|
||||||
#include <QJsonArray>
|
#include <QJsonArray>
|
||||||
|
|
||||||
using namespace Core;
|
using namespace Core;
|
||||||
@@ -2999,7 +2999,7 @@ static void handleShowModuleSymbols(const DebuggerResponse &response,
|
|||||||
|
|
||||||
void GdbEngine::requestModuleSymbols(const QString &modulePath)
|
void GdbEngine::requestModuleSymbols(const QString &modulePath)
|
||||||
{
|
{
|
||||||
QTemporaryFile tf(QDir::tempPath() + "/gdbsymbols");
|
Utils::TemporaryFile tf("gdbsymbols");
|
||||||
if (!tf.open())
|
if (!tf.open())
|
||||||
return;
|
return;
|
||||||
QString fileName = tf.fileName();
|
QString fileName = tf.fileName();
|
||||||
@@ -3351,7 +3351,7 @@ void GdbEngine::handleThreadNames(const DebuggerResponse &response)
|
|||||||
void GdbEngine::createSnapshot()
|
void GdbEngine::createSnapshot()
|
||||||
{
|
{
|
||||||
QString fileName;
|
QString fileName;
|
||||||
QTemporaryFile tf(QDir::tempPath() + "/gdbsnapshot");
|
Utils::TemporaryFile tf("gdbsnapshot");
|
||||||
if (tf.open()) {
|
if (tf.open()) {
|
||||||
fileName = tf.fileName();
|
fileName = tf.fileName();
|
||||||
tf.close();
|
tf.close();
|
||||||
|
|||||||
@@ -30,6 +30,8 @@
|
|||||||
#include <coreplugin/editormanager/ieditor.h>
|
#include <coreplugin/editormanager/ieditor.h>
|
||||||
#include <coreplugin/idocument.h>
|
#include <coreplugin/idocument.h>
|
||||||
|
|
||||||
|
#include <utils/temporaryfile.h>
|
||||||
|
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
@@ -41,7 +43,6 @@
|
|||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QTemporaryFile>
|
|
||||||
|
|
||||||
// Widget showing the image in a 1-pixel frame with context menu.
|
// Widget showing the image in a 1-pixel frame with context menu.
|
||||||
class ImageWidget : public QWidget
|
class ImageWidget : public QWidget
|
||||||
@@ -131,12 +132,9 @@ void ImageViewer::clicked(const QString &message)
|
|||||||
// Open Qt Creator's image viewer
|
// Open Qt Creator's image viewer
|
||||||
static void openImageViewer(const QImage &image)
|
static void openImageViewer(const QImage &image)
|
||||||
{
|
{
|
||||||
QString fileName = QDir::tempPath();
|
QString fileName;
|
||||||
if (!fileName.endsWith(QLatin1Char('/')))
|
|
||||||
fileName += QLatin1Char('/');
|
|
||||||
fileName += QLatin1String("qtcreatorXXXXXX.png");
|
|
||||||
{
|
{
|
||||||
QTemporaryFile temporaryFile(fileName);
|
Utils::TemporaryFile temporaryFile("qtcreatorXXXXXX.png");
|
||||||
temporaryFile.setAutoRemove(false);
|
temporaryFile.setAutoRemove(false);
|
||||||
image.save(&temporaryFile);
|
image.save(&temporaryFile);
|
||||||
fileName = temporaryFile.fileName();
|
fileName = temporaryFile.fileName();
|
||||||
|
|||||||
@@ -35,12 +35,12 @@
|
|||||||
#include <ssh/sftpfilesystemmodel.h>
|
#include <ssh/sftpfilesystemmodel.h>
|
||||||
#include <utils/pathchooser.h>
|
#include <utils/pathchooser.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
#include <utils/temporaryfile.h>
|
||||||
|
|
||||||
#include <QCheckBox>
|
#include <QCheckBox>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QRegExp>
|
#include <QRegExp>
|
||||||
#include <QTemporaryFile>
|
|
||||||
|
|
||||||
#include <QDialogButtonBox>
|
#include <QDialogButtonBox>
|
||||||
#include <QFormLayout>
|
#include <QFormLayout>
|
||||||
@@ -184,7 +184,7 @@ void SelectRemoteFileDialog::selectFile()
|
|||||||
this, &SelectRemoteFileDialog::handleSftpOperationFinished);
|
this, &SelectRemoteFileDialog::handleSftpOperationFinished);
|
||||||
|
|
||||||
{
|
{
|
||||||
QTemporaryFile localFile(QDir::tempPath() + QLatin1String("/remotecore-XXXXXX"));
|
Utils::TemporaryFile localFile("remotecore-XXXXXX");
|
||||||
localFile.open();
|
localFile.open();
|
||||||
m_localFile = localFile.fileName();
|
m_localFile = localFile.fileName();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,9 +34,9 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
#include <utils/temporaryfile.h>
|
||||||
|
|
||||||
#include <QSocketNotifier>
|
#include <QSocketNotifier>
|
||||||
#include <QTemporaryFile>
|
|
||||||
#include <QVarLengthArray>
|
#include <QVarLengthArray>
|
||||||
|
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
@@ -85,7 +85,7 @@ bool OutputCollector::listen()
|
|||||||
QByteArray codedServerPath;
|
QByteArray codedServerPath;
|
||||||
forever {
|
forever {
|
||||||
{
|
{
|
||||||
QTemporaryFile tf;
|
Utils::TemporaryFile tf("outputcollector");
|
||||||
if (!tf.open()) {
|
if (!tf.open()) {
|
||||||
m_errorString = tr("Cannot create temporary file: %1").arg(tf.errorString());
|
m_errorString = tr("Cannot create temporary file: %1").arg(tf.errorString());
|
||||||
m_serverPath.clear();
|
m_serverPath.clear();
|
||||||
|
|||||||
@@ -30,6 +30,7 @@
|
|||||||
|
|
||||||
#include <utils/pathchooser.h>
|
#include <utils/pathchooser.h>
|
||||||
#include <utils/checkablemessagebox.h>
|
#include <utils/checkablemessagebox.h>
|
||||||
|
#include <utils/temporarydirectory.h>
|
||||||
|
|
||||||
#include "symbolpathsdialog.h"
|
#include "symbolpathsdialog.h"
|
||||||
|
|
||||||
@@ -139,7 +140,7 @@ CdbSymbolPathListEditor::CdbSymbolPathListEditor(QWidget *parent) :
|
|||||||
bool CdbSymbolPathListEditor::promptCacheDirectory(QWidget *parent, QString *cacheDirectory)
|
bool CdbSymbolPathListEditor::promptCacheDirectory(QWidget *parent, QString *cacheDirectory)
|
||||||
{
|
{
|
||||||
CacheDirectoryDialog dialog(parent);
|
CacheDirectoryDialog dialog(parent);
|
||||||
dialog.setPath(QDir::tempPath() + QDir::separator() + QLatin1String("symbolcache"));
|
dialog.setPath(Utils::TemporaryDirectory::masterDirectoryPath() + "/symbolcache");
|
||||||
if (dialog.exec() != QDialog::Accepted)
|
if (dialog.exec() != QDialog::Accepted)
|
||||||
return false;
|
return false;
|
||||||
*cacheDirectory = dialog.path();
|
*cacheDirectory = dialog.path();
|
||||||
@@ -165,7 +166,7 @@ void CdbSymbolPathListEditor::setupSymbolPaths()
|
|||||||
if (path.isEmpty() && indexOfSymbolCache != -1)
|
if (path.isEmpty() && indexOfSymbolCache != -1)
|
||||||
path = currentPaths.at(indexOfSymbolCache);
|
path = currentPaths.at(indexOfSymbolCache);
|
||||||
if (path.isEmpty())
|
if (path.isEmpty())
|
||||||
path = QDir::tempPath() + QDir::separator() + QLatin1String("symbolcache");
|
path = Utils::TemporaryDirectory::masterDirectoryPath() + "/symbolcache";
|
||||||
|
|
||||||
bool useSymbolServer = true;
|
bool useSymbolServer = true;
|
||||||
bool useSymbolCache = true;
|
bool useSymbolCache = true;
|
||||||
|
|||||||
@@ -40,11 +40,11 @@
|
|||||||
|
|
||||||
#include <utils/progressindicator.h>
|
#include <utils/progressindicator.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
#include <utils/temporaryfile.h>
|
||||||
|
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QTemporaryFile>
|
|
||||||
#include <QTextCodec>
|
#include <QTextCodec>
|
||||||
|
|
||||||
using namespace Core;
|
using namespace Core;
|
||||||
@@ -169,7 +169,7 @@ void DiffEditorWidgetController::patch(bool revert)
|
|||||||
if (!textDocument)
|
if (!textDocument)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
QTemporaryFile contentsCopy;
|
Utils::TemporaryFile contentsCopy("diff");
|
||||||
if (!contentsCopy.open())
|
if (!contentsCopy.open())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|||||||
@@ -60,7 +60,6 @@
|
|||||||
#include <QAction>
|
#include <QAction>
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QTemporaryFile>
|
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QMap>
|
#include <QMap>
|
||||||
#include <QFutureWatcher>
|
#include <QFutureWatcher>
|
||||||
|
|||||||
@@ -51,6 +51,7 @@
|
|||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
#include <utils/qtcprocess.h>
|
#include <utils/qtcprocess.h>
|
||||||
#include <utils/synchronousprocess.h>
|
#include <utils/synchronousprocess.h>
|
||||||
|
#include <utils/temporaryfile.h>
|
||||||
|
|
||||||
#include <vcsbase/submitfilemodel.h>
|
#include <vcsbase/submitfilemodel.h>
|
||||||
#include <vcsbase/vcsbaseeditor.h>
|
#include <vcsbase/vcsbaseeditor.h>
|
||||||
@@ -72,7 +73,6 @@
|
|||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
#include <QRegExp>
|
#include <QRegExp>
|
||||||
#include <QTemporaryFile>
|
|
||||||
#include <QTextCodec>
|
#include <QTextCodec>
|
||||||
#include <QToolButton>
|
#include <QToolButton>
|
||||||
|
|
||||||
@@ -687,7 +687,7 @@ void GitClient::slotUnstageChunk()
|
|||||||
|
|
||||||
void GitClient::stage(const QString &patch, bool revert)
|
void GitClient::stage(const QString &patch, bool revert)
|
||||||
{
|
{
|
||||||
QTemporaryFile patchFile;
|
Utils::TemporaryFile patchFile("git-patchfile");
|
||||||
if (!patchFile.open())
|
if (!patchFile.open())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|||||||
@@ -38,12 +38,13 @@
|
|||||||
#include <vcsbase/vcsoutputwindow.h>
|
#include <vcsbase/vcsoutputwindow.h>
|
||||||
#include <texteditor/textdocument.h>
|
#include <texteditor/textdocument.h>
|
||||||
|
|
||||||
|
#include <utils/temporaryfile.h>
|
||||||
|
|
||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
|
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
#include <QRegExp>
|
#include <QRegExp>
|
||||||
#include <QSet>
|
#include <QSet>
|
||||||
#include <QTemporaryFile>
|
|
||||||
#include <QTextCodec>
|
#include <QTextCodec>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
|
|
||||||
@@ -217,7 +218,7 @@ void GitEditorWidget::logChange()
|
|||||||
|
|
||||||
void GitEditorWidget::applyDiffChunk(const DiffChunk& chunk, bool revert)
|
void GitEditorWidget::applyDiffChunk(const DiffChunk& chunk, bool revert)
|
||||||
{
|
{
|
||||||
QTemporaryFile patchFile;
|
Utils::TemporaryFile patchFile("git-apply-chunk");
|
||||||
if (!patchFile.open())
|
if (!patchFile.open())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|||||||
@@ -30,10 +30,10 @@
|
|||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
|
|
||||||
#include <utils/fileutils.h>
|
#include <utils/fileutils.h>
|
||||||
|
#include <utils/temporarydirectory.h>
|
||||||
|
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
#include <QStringBuilder>
|
#include <QStringBuilder>
|
||||||
#include <QDir>
|
|
||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
|
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
@@ -135,7 +135,7 @@ bool HelpViewer::launchWithExternalApp(const QUrl &url)
|
|||||||
|
|
||||||
const QString& path = resolvedUrl.path();
|
const QString& path = resolvedUrl.path();
|
||||||
if (!canOpenPage(path)) {
|
if (!canOpenPage(path)) {
|
||||||
Utils::TempFileSaver saver(QDir::tempPath()
|
Utils::TempFileSaver saver(Utils::TemporaryDirectory::masterDirectoryPath()
|
||||||
+ "/qtchelp_XXXXXX." + QFileInfo(path).completeSuffix());
|
+ "/qtchelp_XXXXXX." + QFileInfo(path).completeSuffix());
|
||||||
saver.setAutoRemove(false);
|
saver.setAutoRemove(false);
|
||||||
if (!saver.hasError())
|
if (!saver.hasError())
|
||||||
|
|||||||
@@ -42,8 +42,9 @@
|
|||||||
|
|
||||||
#include <qtsupport/qtkitinformation.h>
|
#include <qtsupport/qtkitinformation.h>
|
||||||
|
|
||||||
|
#include <utils/temporaryfile.h>
|
||||||
|
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QTemporaryFile>
|
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
|
|
||||||
@@ -275,7 +276,7 @@ void IosDeployStep::checkProvisioningProfile()
|
|||||||
return;
|
return;
|
||||||
end += 8;
|
end += 8;
|
||||||
|
|
||||||
QTemporaryFile f;
|
Utils::TemporaryFile f("iosdeploy");
|
||||||
if (!f.open())
|
if (!f.open())
|
||||||
return;
|
return;
|
||||||
f.write(provisionData.mid(start, end - start));
|
f.write(provisionData.mid(start, end - start));
|
||||||
|
|||||||
@@ -35,6 +35,7 @@
|
|||||||
#include <utils/fileutils.h>
|
#include <utils/fileutils.h>
|
||||||
#include "utils/runextensions.h"
|
#include "utils/runextensions.h"
|
||||||
#include "utils/synchronousprocess.h"
|
#include "utils/synchronousprocess.h"
|
||||||
|
#include "utils/temporaryfile.h"
|
||||||
|
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
@@ -50,7 +51,6 @@
|
|||||||
#include <QProcessEnvironment>
|
#include <QProcessEnvironment>
|
||||||
#include <QScopedArrayPointer>
|
#include <QScopedArrayPointer>
|
||||||
#include <QSocketNotifier>
|
#include <QSocketNotifier>
|
||||||
#include <QTemporaryFile>
|
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
#include <QXmlStreamReader>
|
#include <QXmlStreamReader>
|
||||||
|
|
||||||
@@ -81,8 +81,8 @@ class LogTailFiles : public QObject
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
|
|
||||||
void exec(QFutureInterface<void> &fi, std::shared_ptr<QTemporaryFile> stdoutFile,
|
void exec(QFutureInterface<void> &fi, std::shared_ptr<Utils::TemporaryFile> stdoutFile,
|
||||||
std::shared_ptr<QTemporaryFile> stderrFile)
|
std::shared_ptr<Utils::TemporaryFile> stderrFile)
|
||||||
{
|
{
|
||||||
if (fi.isCanceled())
|
if (fi.isCanceled())
|
||||||
return;
|
return;
|
||||||
@@ -96,7 +96,7 @@ public:
|
|||||||
watcher.setFuture(fi.future());
|
watcher.setFuture(fi.future());
|
||||||
|
|
||||||
// Process to print the console output while app is running.
|
// Process to print the console output while app is running.
|
||||||
auto logProcess = [this, fi](QProcess *tailProcess, std::shared_ptr<QTemporaryFile> file) {
|
auto logProcess = [this, fi](QProcess *tailProcess, std::shared_ptr<Utils::TemporaryFile> file) {
|
||||||
QObject::connect(tailProcess, &QProcess::readyReadStandardOutput, [=]() {
|
QObject::connect(tailProcess, &QProcess::readyReadStandardOutput, [=]() {
|
||||||
if (!fi.isCanceled())
|
if (!fi.isCanceled())
|
||||||
emit logMessage(QString::fromLocal8Bit(tailProcess->readAll()));
|
emit logMessage(QString::fromLocal8Bit(tailProcess->readAll()));
|
||||||
@@ -910,16 +910,13 @@ void IosSimulatorToolHandlerPrivate::launchAppOnSimulator(const QStringList &ext
|
|||||||
const QString bundleId = SimulatorControl::bundleIdentifier(appBundle);
|
const QString bundleId = SimulatorControl::bundleIdentifier(appBundle);
|
||||||
const bool debugRun = runKind == IosToolHandler::DebugRun;
|
const bool debugRun = runKind == IosToolHandler::DebugRun;
|
||||||
bool captureConsole = IosConfigurations::xcodeVersion() >= QVersionNumber(8);
|
bool captureConsole = IosConfigurations::xcodeVersion() >= QVersionNumber(8);
|
||||||
std::shared_ptr<QTemporaryFile> stdoutFile;
|
std::shared_ptr<Utils::TemporaryFile> stdoutFile;
|
||||||
std::shared_ptr<QTemporaryFile> stderrFile;
|
std::shared_ptr<Utils::TemporaryFile> stderrFile;
|
||||||
|
|
||||||
if (captureConsole) {
|
if (captureConsole) {
|
||||||
const QString fileTemplate = CONSOLE_PATH_TEMPLATE.arg(deviceId).arg(bundleId);
|
const QString fileTemplate = CONSOLE_PATH_TEMPLATE.arg(deviceId).arg(bundleId);
|
||||||
stdoutFile.reset(new QTemporaryFile);
|
stdoutFile.reset(new Utils::TemporaryFile(fileTemplate + ".stdout"));
|
||||||
stdoutFile->setFileTemplate(fileTemplate + QStringLiteral(".stdout"));
|
stderrFile.reset(new Utils::TemporaryFile(fileTemplate + ".stderr"));
|
||||||
|
|
||||||
stderrFile.reset(new QTemporaryFile);
|
|
||||||
stderrFile->setFileTemplate(fileTemplate + QStringLiteral(".stderr"));
|
|
||||||
|
|
||||||
captureConsole = stdoutFile->open() && stderrFile->open();
|
captureConsole = stdoutFile->open() && stderrFile->open();
|
||||||
if (!captureConsole)
|
if (!captureConsole)
|
||||||
|
|||||||
@@ -49,6 +49,7 @@
|
|||||||
#include <utils/parameteraction.h>
|
#include <utils/parameteraction.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
#include <utils/synchronousprocess.h>
|
#include <utils/synchronousprocess.h>
|
||||||
|
#include <utils/temporarydirectory.h>
|
||||||
#include <vcsbase/basevcseditorfactory.h>
|
#include <vcsbase/basevcseditorfactory.h>
|
||||||
#include <vcsbase/basevcssubmiteditorfactory.h>
|
#include <vcsbase/basevcssubmiteditorfactory.h>
|
||||||
#include <vcsbase/vcsbaseeditor.h>
|
#include <vcsbase/vcsbaseeditor.h>
|
||||||
@@ -934,11 +935,7 @@ PerforcePlugin::createTemporaryArgumentFile(const QStringList &extraArgs,
|
|||||||
// create pattern
|
// create pattern
|
||||||
QString pattern = m_instance->m_tempFilePattern;
|
QString pattern = m_instance->m_tempFilePattern;
|
||||||
if (pattern.isEmpty()) {
|
if (pattern.isEmpty()) {
|
||||||
pattern = QDir::tempPath();
|
pattern = Utils::TemporaryDirectory::masterDirectoryPath() + "/qtc_p4_XXXXXX.args";
|
||||||
const QChar slash = QLatin1Char('/');
|
|
||||||
if (!pattern.endsWith(slash))
|
|
||||||
pattern += slash;
|
|
||||||
pattern += QLatin1String("qtc_p4_XXXXXX.args");
|
|
||||||
m_instance->m_tempFilePattern = pattern;
|
m_instance->m_tempFilePattern = pattern;
|
||||||
}
|
}
|
||||||
QSharedPointer<TempFileSaver> rc(new TempFileSaver(pattern));
|
QSharedPointer<TempFileSaver> rc(new TempFileSaver(pattern));
|
||||||
|
|||||||
@@ -33,10 +33,10 @@
|
|||||||
#include <utils/hostosinfo.h>
|
#include <utils/hostosinfo.h>
|
||||||
#include <utils/qtcprocess.h>
|
#include <utils/qtcprocess.h>
|
||||||
#include <utils/synchronousprocess.h>
|
#include <utils/synchronousprocess.h>
|
||||||
|
#include <utils/temporarydirectory.h>
|
||||||
|
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QSysInfo>
|
#include <QSysInfo>
|
||||||
#include <QTemporaryFile>
|
|
||||||
#include <QTextCodec>
|
#include <QTextCodec>
|
||||||
|
|
||||||
enum { debug = 0 };
|
enum { debug = 0 };
|
||||||
@@ -261,11 +261,9 @@ bool AbstractMsvcToolChain::generateEnvironmentSettings(const Utils::Environment
|
|||||||
const QString marker = "####################";
|
const QString marker = "####################";
|
||||||
// Create a temporary file name for the output. Use a temporary file here
|
// Create a temporary file name for the output. Use a temporary file here
|
||||||
// as I don't know another way to do this in Qt...
|
// as I don't know another way to do this in Qt...
|
||||||
// Note, can't just use a QTemporaryFile all the way through as it remains open
|
|
||||||
// internally so it can't be streamed to later.
|
|
||||||
|
|
||||||
// Create a batch file to create and save the env settings
|
// Create a batch file to create and save the env settings
|
||||||
Utils::TempFileSaver saver(QDir::tempPath() + QLatin1String("/XXXXXX.bat"));
|
Utils::TempFileSaver saver(Utils::TemporaryDirectory::masterDirectoryPath() + "/XXXXXX.bat");
|
||||||
|
|
||||||
QByteArray call = "call ";
|
QByteArray call = "call ";
|
||||||
call += Utils::QtcProcess::quoteArg(batchFile).toLocal8Bit();
|
call += Utils::QtcProcess::quoteArg(batchFile).toLocal8Bit();
|
||||||
|
|||||||
@@ -32,17 +32,17 @@
|
|||||||
#include <utils/mimetypes/mimedatabase.h>
|
#include <utils/mimetypes/mimedatabase.h>
|
||||||
#include <utils/macroexpander.h>
|
#include <utils/macroexpander.h>
|
||||||
#include <utils/templateengine.h>
|
#include <utils/templateengine.h>
|
||||||
|
#include <utils/temporarydirectory.h>
|
||||||
|
#include <utils/temporaryfile.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
#include <QDate>
|
#include <QDate>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QDir>
|
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
#include <QIcon>
|
#include <QIcon>
|
||||||
#include <QJSEngine>
|
#include <QJSEngine>
|
||||||
#include <QTemporaryFile>
|
|
||||||
#include <QTime>
|
#include <QTime>
|
||||||
#include <QXmlStreamAttribute>
|
#include <QXmlStreamAttribute>
|
||||||
#include <QXmlStreamReader>
|
#include <QXmlStreamReader>
|
||||||
@@ -853,16 +853,12 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
TemporaryFileTransform::TemporaryFileTransform(TemporaryFilePtrList *f) :
|
TemporaryFileTransform::TemporaryFileTransform(TemporaryFilePtrList *f) :
|
||||||
m_files(f), m_pattern(QDir::tempPath())
|
m_files(f), m_pattern(Utils::TemporaryDirectory::masterDirectoryPath() + "/qtcreatorXXXXXX.txt")
|
||||||
{
|
{ }
|
||||||
if (!m_pattern.endsWith(QLatin1Char('/')))
|
|
||||||
m_pattern += QLatin1Char('/');
|
|
||||||
m_pattern += QLatin1String("qtcreatorXXXXXX.txt");
|
|
||||||
}
|
|
||||||
|
|
||||||
QString TemporaryFileTransform::operator()(const QString &value) const
|
QString TemporaryFileTransform::operator()(const QString &value) const
|
||||||
{
|
{
|
||||||
TemporaryFilePtr temporaryFile(new QTemporaryFile(m_pattern));
|
TemporaryFilePtr temporaryFile(new Utils::TemporaryFile(m_pattern));
|
||||||
QTC_ASSERT(temporaryFile->open(), return QString());
|
QTC_ASSERT(temporaryFile->open(), return QString());
|
||||||
|
|
||||||
temporaryFile->write(value.toLocal8Bit());
|
temporaryFile->write(value.toLocal8Bit());
|
||||||
|
|||||||
@@ -34,10 +34,11 @@
|
|||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
class QIODevice;
|
class QIODevice;
|
||||||
class QDebug;
|
class QDebug;
|
||||||
class QTemporaryFile;
|
|
||||||
class QJSEngine;
|
class QJSEngine;
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
|
namespace Utils { class TemporaryFile; }
|
||||||
|
|
||||||
namespace ProjectExplorer {
|
namespace ProjectExplorer {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
@@ -136,7 +137,7 @@ public:
|
|||||||
class CustomWizardContext {
|
class CustomWizardContext {
|
||||||
public:
|
public:
|
||||||
typedef QMap<QString, QString> FieldReplacementMap;
|
typedef QMap<QString, QString> FieldReplacementMap;
|
||||||
typedef QSharedPointer<QTemporaryFile> TemporaryFilePtr;
|
typedef QSharedPointer<Utils::TemporaryFile> TemporaryFilePtr;
|
||||||
typedef QList<TemporaryFilePtr> TemporaryFilePtrList;
|
typedef QList<TemporaryFilePtr> TemporaryFilePtrList;
|
||||||
|
|
||||||
void reset();
|
void reset();
|
||||||
|
|||||||
@@ -29,11 +29,10 @@
|
|||||||
|
|
||||||
#include <utils/hostosinfo.h>
|
#include <utils/hostosinfo.h>
|
||||||
#include <utils/synchronousprocess.h>
|
#include <utils/synchronousprocess.h>
|
||||||
|
#include <utils/temporarydirectory.h>
|
||||||
|
|
||||||
#include <QDir>
|
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QTemporaryFile>
|
|
||||||
#include <QSharedPointer>
|
#include <QSharedPointer>
|
||||||
|
|
||||||
namespace ProjectExplorer {
|
namespace ProjectExplorer {
|
||||||
@@ -147,8 +146,8 @@ Core::GeneratedFiles
|
|||||||
{
|
{
|
||||||
// Run in temporary directory as the target path may not exist yet.
|
// Run in temporary directory as the target path may not exist yet.
|
||||||
QString stdOut;
|
QString stdOut;
|
||||||
if (!runGenerationScriptHelper(QDir::tempPath(), script, arguments, true,
|
if (!runGenerationScriptHelper(Utils::TemporaryDirectory::masterDirectoryPath(),
|
||||||
fieldMap, &stdOut, errorMessage))
|
script, arguments, true, fieldMap, &stdOut, errorMessage))
|
||||||
return Core::GeneratedFiles();
|
return Core::GeneratedFiles();
|
||||||
Core::GeneratedFiles files;
|
Core::GeneratedFiles files;
|
||||||
// Parse the output consisting of lines with ',' separated tokens.
|
// Parse the output consisting of lines with ',' separated tokens.
|
||||||
|
|||||||
@@ -29,6 +29,7 @@
|
|||||||
#include "task.h"
|
#include "task.h"
|
||||||
|
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
#include <utils/temporarydirectory.h>
|
||||||
|
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
@@ -501,18 +502,14 @@ void ProjectExplorerPlugin::testGnuMakeParserTaskMangling()
|
|||||||
QFETCH(Task, outputTask);
|
QFETCH(Task, outputTask);
|
||||||
|
|
||||||
// setup files:
|
// setup files:
|
||||||
QString tempdir = QDir::tempPath();
|
const QString tempdir
|
||||||
const QChar slash = QLatin1Char('/');
|
= Utils::TemporaryDirectory::masterDirectoryPath() + '/' + QUuid::createUuid().toString() + '/';
|
||||||
tempdir.append(slash);
|
|
||||||
tempdir.append(QUuid::createUuid().toString());
|
|
||||||
tempdir.append(slash);
|
|
||||||
|
|
||||||
QDir filedir(tempdir);
|
QDir filedir(tempdir);
|
||||||
foreach (const QString &file, files) {
|
foreach (const QString &file, files) {
|
||||||
Q_ASSERT(!file.startsWith(slash));
|
Q_ASSERT(!file.startsWith('/'));
|
||||||
Q_ASSERT(!file.contains(QLatin1String("../")));
|
Q_ASSERT(!file.contains("../"));
|
||||||
|
|
||||||
filedir.mkpath(file.left(file.lastIndexOf(slash)));
|
filedir.mkpath(file.left(file.lastIndexOf('/')));
|
||||||
|
|
||||||
QFile tempfile(tempdir + file);
|
QFile tempfile(tempdir + file);
|
||||||
if (!tempfile.open(QIODevice::WriteOnly))
|
if (!tempfile.open(QIODevice::WriteOnly))
|
||||||
|
|||||||
@@ -33,6 +33,7 @@
|
|||||||
#include <utils/winutils.h>
|
#include <utils/winutils.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
#include <utils/hostosinfo.h>
|
#include <utils/hostosinfo.h>
|
||||||
|
#include <utils/temporarydirectory.h>
|
||||||
|
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
@@ -318,7 +319,7 @@ QByteArray MsvcToolChain::msvcPredefinedMacros(const QStringList cxxflags,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Utils::TempFileSaver saver(QDir::tempPath() + QLatin1String("/envtestXXXXXX.cpp"));
|
Utils::TempFileSaver saver(Utils::TemporaryDirectory::masterDirectoryPath() + "/envtestXXXXXX.cpp");
|
||||||
saver.write(msvcCompilationFile());
|
saver.write(msvcCompilationFile());
|
||||||
if (!saver.finalize()) {
|
if (!saver.finalize()) {
|
||||||
qWarning("%s: %s", Q_FUNC_INFO, qPrintable(saver.errorString()));
|
qWarning("%s: %s", Q_FUNC_INFO, qPrintable(saver.errorString()));
|
||||||
@@ -326,7 +327,7 @@ QByteArray MsvcToolChain::msvcPredefinedMacros(const QStringList cxxflags,
|
|||||||
}
|
}
|
||||||
Utils::SynchronousProcess cpp;
|
Utils::SynchronousProcess cpp;
|
||||||
cpp.setEnvironment(env.toStringList());
|
cpp.setEnvironment(env.toStringList());
|
||||||
cpp.setWorkingDirectory(QDir::tempPath());
|
cpp.setWorkingDirectory(Utils::TemporaryDirectory::masterDirectoryPath());
|
||||||
QStringList arguments;
|
QStringList arguments;
|
||||||
const Utils::FileName binary = env.searchInPath(QLatin1String("cl.exe"));
|
const Utils::FileName binary = env.searchInPath(QLatin1String("cl.exe"));
|
||||||
if (binary.isEmpty()) {
|
if (binary.isEmpty()) {
|
||||||
|
|||||||
@@ -48,9 +48,9 @@
|
|||||||
#include <utils/algorithm.h>
|
#include <utils/algorithm.h>
|
||||||
#include <utils/environment.h>
|
#include <utils/environment.h>
|
||||||
#include <utils/hostosinfo.h>
|
#include <utils/hostosinfo.h>
|
||||||
|
#include <utils/temporarydirectory.h>
|
||||||
|
|
||||||
#include <QProcess>
|
#include <QProcess>
|
||||||
#include <QTemporaryDir>
|
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
#include <QCryptographicHash>
|
#include <QCryptographicHash>
|
||||||
#include <QDateTime>
|
#include <QDateTime>
|
||||||
@@ -243,7 +243,7 @@ bool PuppetCreator::build(const QString &qmlPuppetProjectFilePath) const
|
|||||||
|
|
||||||
m_compileLog.clear();
|
m_compileLog.clear();
|
||||||
|
|
||||||
QTemporaryDir buildDirectory;
|
Utils::TemporaryDirectory buildDirectory("qml-puppet-build");
|
||||||
|
|
||||||
bool buildSucceeded = false;
|
bool buildSucceeded = false;
|
||||||
|
|
||||||
|
|||||||
@@ -34,6 +34,8 @@
|
|||||||
#include <qmldebug/qmldebugcommandlinearguments.h>
|
#include <qmldebug/qmldebugcommandlinearguments.h>
|
||||||
#include <debugger/analyzer/analyzerruncontrol.h>
|
#include <debugger/analyzer/analyzerruncontrol.h>
|
||||||
|
|
||||||
|
#include <utils/temporaryfile.h>
|
||||||
|
|
||||||
#include <QTcpServer>
|
#include <QTcpServer>
|
||||||
#include <QTemporaryFile>
|
#include <QTemporaryFile>
|
||||||
|
|
||||||
@@ -43,7 +45,7 @@ namespace QmlProfiler {
|
|||||||
|
|
||||||
QString LocalQmlProfilerRunner::findFreeSocket()
|
QString LocalQmlProfilerRunner::findFreeSocket()
|
||||||
{
|
{
|
||||||
QTemporaryFile file;
|
Utils::TemporaryFile file("qmlprofiler-freesocket");
|
||||||
if (file.open()) {
|
if (file.open()) {
|
||||||
return file.fileName();
|
return file.fileName();
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -31,10 +31,11 @@
|
|||||||
#include "qmltypedevent.h"
|
#include "qmltypedevent.h"
|
||||||
|
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
#include <utils/temporaryfile.h>
|
||||||
|
|
||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QStack>
|
#include <QStack>
|
||||||
#include <QTemporaryFile>
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
namespace QmlProfiler {
|
namespace QmlProfiler {
|
||||||
@@ -42,6 +43,7 @@ namespace QmlProfiler {
|
|||||||
class QmlProfilerDataModel::QmlProfilerDataModelPrivate
|
class QmlProfilerDataModel::QmlProfilerDataModelPrivate
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
QmlProfilerDataModelPrivate() : file("qmlprofiler-data") { }
|
||||||
void rewriteType(int typeIndex);
|
void rewriteType(int typeIndex);
|
||||||
int resolveStackTop();
|
int resolveStackTop();
|
||||||
|
|
||||||
@@ -51,7 +53,7 @@ public:
|
|||||||
int modelId;
|
int modelId;
|
||||||
Internal::QmlProfilerDetailsRewriter *detailsRewriter;
|
Internal::QmlProfilerDetailsRewriter *detailsRewriter;
|
||||||
|
|
||||||
QTemporaryFile file;
|
Utils::TemporaryFile file;
|
||||||
QDataStream eventStream;
|
QDataStream eventStream;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -28,12 +28,12 @@
|
|||||||
|
|
||||||
#include <utils/hostosinfo.h>
|
#include <utils/hostosinfo.h>
|
||||||
#include <utils/synchronousprocess.h>
|
#include <utils/synchronousprocess.h>
|
||||||
|
#include <utils/temporaryfile.h>
|
||||||
|
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QDomDocument>
|
#include <QDomDocument>
|
||||||
#include <QProcess>
|
#include <QProcess>
|
||||||
#include <QStandardPaths>
|
#include <QStandardPaths>
|
||||||
#include <QTemporaryFile>
|
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
|
|
||||||
using namespace ProjectExplorer;
|
using namespace ProjectExplorer;
|
||||||
@@ -100,9 +100,8 @@ QList<Utils::EnvironmentItem> QnxUtils::qnxEnvironmentFromEnvFile(const QString
|
|||||||
const bool isWindows = Utils::HostOsInfo::isWindowsHost();
|
const bool isWindows = Utils::HostOsInfo::isWindowsHost();
|
||||||
|
|
||||||
// locking creating bbndk-env file wrapper script
|
// locking creating bbndk-env file wrapper script
|
||||||
QTemporaryFile tmpFile(
|
Utils::TemporaryFile tmpFile(QString::fromLatin1("bbndk-env-eval-XXXXXX")
|
||||||
QDir::tempPath() + QLatin1Char('/')
|
+ QString::fromLatin1(isWindows ? ".bat" : ".sh"));
|
||||||
+ QLatin1String("bbndk-env-eval-XXXXXX") + QLatin1String(isWindows ? ".bat" : ".sh"));
|
|
||||||
if (!tmpFile.open())
|
if (!tmpFile.open())
|
||||||
return items;
|
return items;
|
||||||
tmpFile.setTextModeEnabled(true);
|
tmpFile.setTextModeEnabled(true);
|
||||||
|
|||||||
@@ -44,7 +44,8 @@ static const char TaskCategory[] = "Task.Category.ExtraCompiler.QScxmlc";
|
|||||||
QScxmlcGenerator::QScxmlcGenerator(const Project *project,
|
QScxmlcGenerator::QScxmlcGenerator(const Project *project,
|
||||||
const Utils::FileName &source,
|
const Utils::FileName &source,
|
||||||
const Utils::FileNameList &targets, QObject *parent) :
|
const Utils::FileNameList &targets, QObject *parent) :
|
||||||
ProcessExtraCompiler(project, source, targets, parent)
|
ProcessExtraCompiler(project, source, targets, parent),
|
||||||
|
m_tmpdir("qscxmlgenerator")
|
||||||
{
|
{
|
||||||
QTC_ASSERT(targets.count() == 2, return);
|
QTC_ASSERT(targets.count() == 2, return);
|
||||||
m_header = m_tmpdir.path() + QLatin1Char('/') + targets[0].fileName();
|
m_header = m_tmpdir.path() + QLatin1Char('/') + targets[0].fileName();
|
||||||
|
|||||||
@@ -27,9 +27,9 @@
|
|||||||
|
|
||||||
#include <projectexplorer/extracompiler.h>
|
#include <projectexplorer/extracompiler.h>
|
||||||
#include <utils/fileutils.h>
|
#include <utils/fileutils.h>
|
||||||
|
#include <utils/temporarydirectory.h>
|
||||||
|
|
||||||
#include <QProcess>
|
#include <QProcess>
|
||||||
#include <QTemporaryDir>
|
|
||||||
|
|
||||||
namespace QtSupport {
|
namespace QtSupport {
|
||||||
|
|
||||||
@@ -51,7 +51,7 @@ private:
|
|||||||
bool prepareToRun(const QByteArray &sourceContents) override;
|
bool prepareToRun(const QByteArray &sourceContents) override;
|
||||||
QList<ProjectExplorer::Task> parseIssues(const QByteArray &processStderr) override;
|
QList<ProjectExplorer::Task> parseIssues(const QByteArray &processStderr) override;
|
||||||
|
|
||||||
QTemporaryDir m_tmpdir;
|
Utils::TemporaryDirectory m_tmpdir;
|
||||||
QString m_header;
|
QString m_header;
|
||||||
QString m_impl;
|
QString m_impl;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -36,6 +36,7 @@
|
|||||||
#include <utils/algorithm.h>
|
#include <utils/algorithm.h>
|
||||||
#include <utils/fileutils.h>
|
#include <utils/fileutils.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
#include <utils/temporarydirectory.h>
|
||||||
|
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
#include <QList>
|
#include <QList>
|
||||||
@@ -364,8 +365,8 @@ void QtSupportPlugin::testQtProjectImporter_oneProject()
|
|||||||
BaseQtVersion *defaultQt = QtKitInformation::qtVersion(defaultKit);
|
BaseQtVersion *defaultQt = QtKitInformation::qtVersion(defaultKit);
|
||||||
QVERIFY(defaultQt);
|
QVERIFY(defaultQt);
|
||||||
|
|
||||||
const QTemporaryDir tempDir1;
|
const Utils::TemporaryDirectory tempDir1("tmp1");
|
||||||
const QTemporaryDir tempDir2;
|
const Utils::TemporaryDirectory tempDir2("tmp2");
|
||||||
|
|
||||||
const QString appDir = QCoreApplication::applicationDirPath();
|
const QString appDir = QCoreApplication::applicationDirPath();
|
||||||
|
|
||||||
|
|||||||
@@ -37,7 +37,6 @@
|
|||||||
#include <utils/reloadpromptutils.h>
|
#include <utils/reloadpromptutils.h>
|
||||||
#include <utils/fileutils.h>
|
#include <utils/fileutils.h>
|
||||||
|
|
||||||
#include <QTemporaryFile>
|
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <qdebug.h>
|
#include <qdebug.h>
|
||||||
|
|||||||
@@ -54,7 +54,6 @@
|
|||||||
#include <QtPlugin>
|
#include <QtPlugin>
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QTemporaryFile>
|
|
||||||
|
|
||||||
using namespace Core;
|
using namespace Core;
|
||||||
|
|
||||||
|
|||||||
@@ -31,10 +31,9 @@
|
|||||||
|
|
||||||
#include <utils/hostosinfo.h>
|
#include <utils/hostosinfo.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
#include <utils/temporaryfile.h>
|
||||||
#include <ssh/sftpchannel.h>
|
#include <ssh/sftpchannel.h>
|
||||||
|
|
||||||
#include <QTemporaryFile>
|
|
||||||
|
|
||||||
#define CALLGRIND_CONTROL_DEBUG 0
|
#define CALLGRIND_CONTROL_DEBUG 0
|
||||||
|
|
||||||
const QLatin1String CALLGRIND_CONTROL_BINARY("callgrind_control");
|
const QLatin1String CALLGRIND_CONTROL_BINARY("callgrind_control");
|
||||||
@@ -228,7 +227,7 @@ void CallgrindController::foundRemoteFile()
|
|||||||
void CallgrindController::sftpInitialized()
|
void CallgrindController::sftpInitialized()
|
||||||
{
|
{
|
||||||
cleanupTempFile();
|
cleanupTempFile();
|
||||||
QTemporaryFile dataFile(QDir::tempPath() + QLatin1Char('/') + QLatin1String("callgrind.out."));
|
Utils::TemporaryFile dataFile("callgrind.out.");
|
||||||
QTC_ASSERT(dataFile.open(), return);
|
QTC_ASSERT(dataFile.open(), return);
|
||||||
m_tempDataFile = dataFile.fileName();
|
m_tempDataFile = dataFile.fileName();
|
||||||
dataFile.setAutoRemove(false);
|
dataFile.setAutoRemove(false);
|
||||||
|
|||||||
@@ -44,6 +44,7 @@
|
|||||||
#include <utils/synchronousprocess.h>
|
#include <utils/synchronousprocess.h>
|
||||||
#include <utils/fileutils.h>
|
#include <utils/fileutils.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
#include <utils/temporarydirectory.h>
|
||||||
#include <coreplugin/find/basetextfind.h>
|
#include <coreplugin/find/basetextfind.h>
|
||||||
#include <texteditor/fontsettings.h>
|
#include <texteditor/fontsettings.h>
|
||||||
#include <texteditor/texteditorsettings.h>
|
#include <texteditor/texteditorsettings.h>
|
||||||
@@ -659,12 +660,7 @@ static inline QString msgCheckScript(const QString &workingDir, const QString &c
|
|||||||
bool VcsBaseSubmitEditor::runSubmitMessageCheckScript(const QString &checkScript, QString *errorMessage) const
|
bool VcsBaseSubmitEditor::runSubmitMessageCheckScript(const QString &checkScript, QString *errorMessage) const
|
||||||
{
|
{
|
||||||
// Write out message
|
// Write out message
|
||||||
QString tempFilePattern = QDir::tempPath();
|
TempFileSaver saver(Utils::TemporaryDirectory::masterDirectoryPath() + "/msgXXXXXX.txt");
|
||||||
const QChar slash = QLatin1Char('/');
|
|
||||||
if (!tempFilePattern.endsWith(slash))
|
|
||||||
tempFilePattern += slash;
|
|
||||||
tempFilePattern += QLatin1String("msgXXXXXX.txt");
|
|
||||||
TempFileSaver saver(tempFilePattern);
|
|
||||||
saver.write(fileContents());
|
saver.write(fileContents());
|
||||||
if (!saver.finalize(errorMessage))
|
if (!saver.finalize(errorMessage))
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user