diff options
author | hjk <hjk@qt.io> | 2019-05-17 13:54:27 +0200 |
---|---|---|
committer | hjk <hjk@qt.io> | 2019-05-20 13:07:38 +0000 |
commit | 535f0da97755b07cd1271fc6f9bfe368e22c7235 (patch) | |
tree | 650335526683bc80c5adb3040175ea30ffaadd5d /src/libs/utils/fileutils.cpp | |
parent | c04370aa2665f36828bfd4001fec2d2a6cf7b9f9 (diff) |
Utils: Make FileName::shortNativePath a member
Change-Id: If1ab02ae9dc7efb97792cdf3bbdce3bba18b3e3d
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Diffstat (limited to 'src/libs/utils/fileutils.cpp')
-rw-r--r-- | src/libs/utils/fileutils.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libs/utils/fileutils.cpp b/src/libs/utils/fileutils.cpp index 6f449fb79de..de7fc358b4d 100644 --- a/src/libs/utils/fileutils.cpp +++ b/src/libs/utils/fileutils.cpp @@ -254,16 +254,16 @@ FileName FileName::canonicalPath() const Returns the possibly shortened path with native separators. */ -QString FileUtils::shortNativePath(const FileName &path) +QString FileName::shortNativePath() const { if (HostOsInfo::isAnyUnixHost()) { const FileName home = FileName::fromString(QDir::cleanPath(QDir::homePath())); - if (path.isChildOf(home)) { + if (isChildOf(home)) { return QLatin1Char('~') + QDir::separator() - + QDir::toNativeSeparators(path.relativeChildPath(home).toString()); + + QDir::toNativeSeparators(relativeChildPath(home).toString()); } } - return path.toUserOutput(); + return toUserOutput(); } QString FileUtils::fileSystemFriendlyName(const QString &name) |