forked from qt-creator/qt-creator
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:
@@ -711,14 +711,10 @@ FilePath FilePath::parentDir() const
|
|||||||
if (basePath.isEmpty())
|
if (basePath.isEmpty())
|
||||||
return FilePath();
|
return FilePath();
|
||||||
|
|
||||||
// TODO: Replace usage of QDir !!
|
|
||||||
const QDir base(basePath);
|
|
||||||
if (base.isRoot())
|
|
||||||
return FilePath();
|
|
||||||
|
|
||||||
const QString path = basePath + QLatin1String("/..");
|
const QString path = basePath + QLatin1String("/..");
|
||||||
const QString parent = doCleanPath(path);
|
const QString parent = doCleanPath(path);
|
||||||
QTC_ASSERT(parent != path, return FilePath());
|
if (parent == path)
|
||||||
|
return FilePath();
|
||||||
|
|
||||||
return withNewPath(parent);
|
return withNewPath(parent);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user