Utils: Make FilePath::resolvePath() work with remote paths

QDir::cleanPath() destroys the :// separator.

Change-Id: I9a4d7cb93fba8a16f6fbbf94fa934459e3667a43
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2021-07-14 12:10:24 +02:00
parent 9d3100ff1e
commit 38f23a9a4a

View File

@@ -390,7 +390,9 @@ FilePath FilePath::resolvePath(const QString &fileName) const
{ {
if (FileUtils::isAbsolutePath(fileName)) if (FileUtils::isAbsolutePath(fileName))
return FilePath::fromString(QDir::cleanPath(fileName)); return FilePath::fromString(QDir::cleanPath(fileName));
return FilePath::fromString(QDir::cleanPath(toString() + QLatin1Char('/') + fileName)); FilePath result = *this;
result.setPath(QDir::cleanPath(m_data + '/' + fileName));
return result;
} }
FilePath FilePath::cleanPath() const FilePath FilePath::cleanPath() const