diff options
author | hjk <hjk@qt.io> | 2021-07-01 09:58:48 +0200 |
---|---|---|
committer | hjk <hjk@qt.io> | 2021-07-02 05:05:12 +0000 |
commit | a58dd22f2d445b27da5085390ada0559dac7321f (patch) | |
tree | ef423d848ef53551a3ff1c795ac095273f2ddd8a /src/plugins/cpptools/cpptoolstestcase.cpp | |
parent | 92904480f0a8d696b3f0dcd46353accb64a44cee (diff) | |
download | qt-creator-a58dd22f2d445b27da5085390ada0559dac7321f.tar.gz |
Utils: Use FilePath in TemporaryDirectory API
This helps to lower impedance in the using code.
Even though TemporaryDirectory will very likely always stay on the local
host, this is one of the entry points into path related string
manipulation
that we want to base on FilePath nowadays.
Change-Id: I302016b8d65e54df94296659a54a93935d9e4627
Reviewed-by: David Schulz <david.schulz@qt.io>
Diffstat (limited to 'src/plugins/cpptools/cpptoolstestcase.cpp')
-rw-r--r-- | src/plugins/cpptools/cpptoolstestcase.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/cpptools/cpptoolstestcase.cpp b/src/plugins/cpptools/cpptoolstestcase.cpp index c80a4a7cff..e9a6e85d0d 100644 --- a/src/plugins/cpptools/cpptoolstestcase.cpp +++ b/src/plugins/cpptools/cpptoolstestcase.cpp @@ -312,7 +312,7 @@ QString TemporaryDir::createFile(const QByteArray &relativePath, const QByteArra if (relativePathString.isEmpty() || QFileInfo(relativePathString).isAbsolute()) return QString(); - const QString filePath = m_temporaryDir.path() + QLatin1Char('/') + relativePathString; + const QString filePath = m_temporaryDir.filePath(relativePathString).path(); if (!TestCase::writeFile(filePath, contents)) return QString(); return filePath; @@ -368,7 +368,7 @@ TemporaryCopiedDir::TemporaryCopiedDir(const QString &sourceDirPath) QString TemporaryCopiedDir::absolutePath(const QByteArray &relativePath) const { - return m_temporaryDir.path() + QLatin1Char('/') + QString::fromUtf8(relativePath); + return m_temporaryDir.filePath(QString::fromUtf8(relativePath)).path(); } FileWriterAndRemover::FileWriterAndRemover(const QString &filePath, const QByteArray &contents) |