Utils: Make FilePath::toFSPathString a full copy of toString

Changing the toString() to prepend system-specific prefixes
to cater for the remote filesystem model handling had unintended
sideeffects.

This here is the first step to split both paths.

Change-Id: I66cdd9a87802408e2ba95c2e29b9d7cce7fe2553
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2022-09-16 10:00:09 +02:00
parent f99e17efa4
commit 31556332f5
2 changed files with 43 additions and 2 deletions

View File

@@ -186,6 +186,7 @@ QString FilePath::toString() const
if (m_scheme.isEmpty())
return m_path;
// FIXME: This OS-independent URL-style output
if (isRelativePath())
return specialPath(SpecialPathComponent::RootPath) + "/" + m_scheme + "/" + encodedHost() + "/./" + m_path;
return specialPath(SpecialPathComponent::RootPath) + "/" + m_scheme + "/" + encodedHost() + m_path;
@@ -193,8 +194,12 @@ QString FilePath::toString() const
QString FilePath::toFSPathString() const
{
// TODO ...
return toString();
if (m_scheme.isEmpty())
return m_path;
if (isRelativePath())
return specialPath(SpecialPathComponent::RootPath) + "/" + m_scheme + "/" + encodedHost() + "/./" + m_path;
return specialPath(SpecialPathComponent::RootPath) + "/" + m_scheme + "/" + encodedHost() + m_path;
}
QUrl FilePath::toUrl() const