aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/perforce
diff options
context:
space:
mode:
authorTobias Hunger <tobias.hunger@qt.io>2017-01-19 16:44:22 +0100
committerTim Jenssen <tim.jenssen@qt.io>2017-01-20 12:17:10 +0000
commitc6f90e575e2e261f7fa50f951b6fc1824ae5c12f (patch)
tree7f3564ad1491a5f40e64bcee89d70b884409885f /src/plugins/perforce
parente6017c40fca059b27e449f0605f4d79b78de0ff3 (diff)
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>
Diffstat (limited to 'src/plugins/perforce')
-rw-r--r--src/plugins/perforce/perforceplugin.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/plugins/perforce/perforceplugin.cpp b/src/plugins/perforce/perforceplugin.cpp
index 3d87ca1cb33..e06c491eecb 100644
--- a/src/plugins/perforce/perforceplugin.cpp
+++ b/src/plugins/perforce/perforceplugin.cpp
@@ -49,6 +49,7 @@
#include <utils/parameteraction.h>
#include <utils/qtcassert.h>
#include <utils/synchronousprocess.h>
+#include <utils/temporarydirectory.h>
#include <vcsbase/basevcseditorfactory.h>
#include <vcsbase/basevcssubmiteditorfactory.h>
#include <vcsbase/vcsbaseeditor.h>
@@ -934,11 +935,7 @@ PerforcePlugin::createTemporaryArgumentFile(const QStringList &extraArgs,
// create pattern
QString pattern = m_instance->m_tempFilePattern;
if (pattern.isEmpty()) {
- pattern = QDir::tempPath();
- const QChar slash = QLatin1Char('/');
- if (!pattern.endsWith(slash))
- pattern += slash;
- pattern += QLatin1String("qtc_p4_XXXXXX.args");
+ pattern = Utils::TemporaryDirectory::masterDirectoryPath() + "/qtc_p4_XXXXXX.args";
m_instance->m_tempFilePattern = pattern;
}
QSharedPointer<TempFileSaver> rc(new TempFileSaver(pattern));