forked from qt-creator/qt-creator
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 <david.schulz@qt.io>
This commit is contained in:
@@ -819,15 +819,6 @@ FilePath FilePath::symLinkTarget() const
|
|||||||
return FilePath::fromString(info.symLinkTarget());
|
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
|
QString FilePath::mapToDevicePath() const
|
||||||
{
|
{
|
||||||
if (needsDevice()) {
|
if (needsDevice()) {
|
||||||
@@ -1182,11 +1173,11 @@ QString FilePath::calcRelativePath(const QString &absolutePath, const QString &a
|
|||||||
*/
|
*/
|
||||||
FilePath FilePath::onDevice(const FilePath &deviceTemplate) const
|
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;
|
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
|
// TODO: converting paths between different non local devices is still unsupported
|
||||||
QTC_CHECK(!needsDevice() || sameDevice);
|
QTC_CHECK(!needsDevice());
|
||||||
FilePath res;
|
FilePath res;
|
||||||
res.m_scheme = deviceTemplate.m_scheme;
|
res.m_scheme = deviceTemplate.m_scheme;
|
||||||
res.m_host = deviceTemplate.m_host;
|
res.m_host = deviceTemplate.m_host;
|
||||||
|
@@ -162,8 +162,6 @@ public:
|
|||||||
QDir::Filters filters = QDir::NoFilter,
|
QDir::Filters filters = QDir::NoFilter,
|
||||||
QDirIterator::IteratorFlags flags = QDirIterator::NoIteratorFlags) const;
|
QDirIterator::IteratorFlags flags = QDirIterator::NoIteratorFlags) const;
|
||||||
|
|
||||||
[[nodiscard]] FilePath mapToGlobalPath() const;
|
|
||||||
|
|
||||||
// makes sure that capitalization of directories is canonical
|
// makes sure that capitalization of directories is canonical
|
||||||
// on Windows and macOS. This is rarely needed.
|
// on Windows and macOS. This is rarely needed.
|
||||||
[[nodiscard]] FilePath normalizedPathName() const;
|
[[nodiscard]] FilePath normalizedPathName() const;
|
||||||
|
Reference in New Issue
Block a user