From d5412588fd785b0d5af5e20c20ab4bdcb146a24f Mon Sep 17 00:00:00 2001 From: hjk Date: Fri, 23 Sep 2022 10:28:59 +0200 Subject: [PATCH] Utils: Remove QDir use from parentDir() implementation cleanPath() is good enough now. Change-Id: I3f0e7a96496c11bc90c4eb83c35d706aeab93aa6 Reviewed-by: Christian Stenger --- src/libs/utils/filepath.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/libs/utils/filepath.cpp b/src/libs/utils/filepath.cpp index ebe053a7a45..b2424b37477 100644 --- a/src/libs/utils/filepath.cpp +++ b/src/libs/utils/filepath.cpp @@ -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); }