Utils: Remove QDir use from parentDir() implementation

cleanPath() is good enough now.

Change-Id: I3f0e7a96496c11bc90c4eb83c35d706aeab93aa6
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2022-09-23 10:28:59 +02:00
parent 7b77085652
commit d5412588fd

View File

@@ -711,14 +711,10 @@ FilePath FilePath::parentDir() const
if (basePath.isEmpty())
return FilePath();
// TODO: Replace usage of QDir !!
const QDir base(basePath);
if (base.isRoot())
return FilePath();
const QString path = basePath + QLatin1String("/..");
const QString parent = doCleanPath(path);
QTC_ASSERT(parent != path, return FilePath());
if (parent == path)
return FilePath();
return withNewPath(parent);
}