From c6bc5583d6913f232e5c6f1343145b5fdeb746ef Mon Sep 17 00:00:00 2001 From: hjk Date: Thu, 28 Oct 2021 07:47:48 +0200 Subject: [PATCH] Utils: Don't expose FilePath::mapToGlobalPath anymore The indirection is triggered via scheme and host. And if it already is in that form we do not need to add these information. Change-Id: I13c2bd0864a956c5cdaa5e2e6b324bb7f67c93e3 Reviewed-by: David Schulz --- src/libs/utils/filepath.cpp | 15 +++------------ src/libs/utils/filepath.h | 2 -- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/src/libs/utils/filepath.cpp b/src/libs/utils/filepath.cpp index dadf791a61e..e17f140868d 100644 --- a/src/libs/utils/filepath.cpp +++ b/src/libs/utils/filepath.cpp @@ -819,15 +819,6 @@ FilePath FilePath::symLinkTarget() const return FilePath::fromString(info.symLinkTarget()); } -FilePath FilePath::mapToGlobalPath() const -{ - if (needsDevice()) { - QTC_ASSERT(s_deviceHooks.mapToGlobalPath, return {}); - return s_deviceHooks.mapToGlobalPath(*this); - } - return *this; -} - QString FilePath::mapToDevicePath() const { if (needsDevice()) { @@ -1182,11 +1173,11 @@ QString FilePath::calcRelativePath(const QString &absolutePath, const QString &a */ FilePath FilePath::onDevice(const FilePath &deviceTemplate) const { - if (!deviceTemplate.needsDevice()) - return mapToGlobalPath(); const bool sameDevice = m_scheme == deviceTemplate.m_scheme && m_host == deviceTemplate.m_host; + if (sameDevice) + return *this; // TODO: converting paths between different non local devices is still unsupported - QTC_CHECK(!needsDevice() || sameDevice); + QTC_CHECK(!needsDevice()); FilePath res; res.m_scheme = deviceTemplate.m_scheme; res.m_host = deviceTemplate.m_host; diff --git a/src/libs/utils/filepath.h b/src/libs/utils/filepath.h index da5ca921bbc..7cb5b9f2b84 100644 --- a/src/libs/utils/filepath.h +++ b/src/libs/utils/filepath.h @@ -162,8 +162,6 @@ public: QDir::Filters filters = QDir::NoFilter, QDirIterator::IteratorFlags flags = QDirIterator::NoIteratorFlags) const; - [[nodiscard]] FilePath mapToGlobalPath() const; - // makes sure that capitalization of directories is canonical // on Windows and macOS. This is rarely needed. [[nodiscard]] FilePath normalizedPathName() const;