Utils: Replace FilePath::rootPath() by some isRootPath()

Keeps more context to make it host-independent later.

Change-Id: I0f8ad3e8794daa6324662847203200ae378d34b4
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
hjk
2022-09-16 11:14:59 +02:00
parent eda8a4244f
commit 06334e1816
4 changed files with 12 additions and 13 deletions

View File

@@ -59,11 +59,9 @@ public:
[[nodiscard]] static FilePath fromParts(const QStringView scheme, const QStringView host, const QStringView path);
[[nodiscard]] static FilePath currentWorkingPath();
[[nodiscard]] static FilePath rootPath();
QString toUserOutput() const;
QString toString() const;
QString toFSPathString() const;
QVariant toVariant() const;
QUrl toUrl() const;
@@ -102,6 +100,7 @@ public:
bool isAbsolutePath() const { return !isRelativePath(); }
bool isFile() const;
bool isDir() const;
bool isRootPath() const;
bool isNewerThan(const QDateTime &timeStamp) const;
QDateTime lastModified() const;
QFile::Permissions permissions() const;
@@ -191,6 +190,7 @@ public:
[[nodiscard]] QFileInfo toFileInfo() const;
[[nodiscard]] static FilePath fromFileInfo(const QFileInfo &info);
// Support for FSEngine. Do not use unless needed.
enum class SpecialPathComponent {
RootName,
RootPath,
@@ -201,6 +201,8 @@ public:
[[nodiscard]] static QString specialPath(SpecialPathComponent component);
[[nodiscard]] static FilePath specialFilePath(SpecialPathComponent component);
QString toFSPathString() const;
private:
friend class ::tst_fileutils;
static QString calcRelativePath(const QString &absolutePath, const QString &absoluteAnchorPath);