forked from qt-creator/qt-creator
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>
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user