Utils: Fix diriterator for scheme folders

Previously the "fileName" of every device inside a scheme subfolder
would be empty. Therefore QDirIterator would skip them.

Change-Id: Ifa46859aadbd8a81364a1fe0a72b9a50a7a396ca
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
Marcus Tillmanns
2023-02-22 15:58:18 +01:00
parent d44126c300
commit 00fd4c8fea
4 changed files with 41 additions and 6 deletions

View File

@@ -233,6 +233,9 @@ QString FilePath::toString() const
if (!needsDevice())
return path();
if (pathView().isEmpty())
return scheme() + "://" + encodedHost();
if (isRelativePath())
return scheme() + "://" + encodedHost() + "/./" + pathView();
return scheme() + "://" + encodedHost() + pathView();
@@ -255,6 +258,9 @@ QString FilePath::toFSPathString() const
if (scheme().isEmpty())
return path();
if (pathView().isEmpty())
return specialRootPath() + '/' + scheme() + '/' + encodedHost();
if (isRelativePath())
return specialRootPath() + '/' + scheme() + '/' + encodedHost() + "/./" + pathView();
return specialRootPath() + '/' + scheme() + '/' + encodedHost() + pathView();