From a58dd22f2d445b27da5085390ada0559dac7321f Mon Sep 17 00:00:00 2001 From: hjk Date: Thu, 1 Jul 2021 09:58:48 +0200 Subject: 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 --- src/plugins/cpptools/cpptoolstestcase.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/plugins/cpptools/cpptoolstestcase.cpp') 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) -- cgit v1.2.1