From 3fd1122759b8f01ea4d0eb78d74aa7ec605a96ce Mon Sep 17 00:00:00 2001 From: hjk Date: Wed, 10 Nov 2021 16:19:25 +0100 Subject: [PATCH] Utils: Rename FilePath::deviceLocalPath() to nativePath() Change-Id: Id2b2b7d54a536d569c6dc717365ee28421e2b56b Reviewed-by: David Schulz --- src/libs/utils/environment.cpp | 10 +++++----- src/libs/utils/filepath.cpp | 2 +- src/libs/utils/filepath.h | 2 +- src/libs/utils/winutils.cpp | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/libs/utils/environment.cpp b/src/libs/utils/environment.cpp index f8e24567eed..7b0a48c6a8b 100644 --- a/src/libs/utils/environment.cpp +++ b/src/libs/utils/environment.cpp @@ -57,7 +57,7 @@ void Environment::appendOrSetPath(const FilePath &value) QTC_CHECK(value.osType() == m_osType); if (value.isEmpty()) return; - appendOrSet("PATH", value.deviceLocalPath(), + appendOrSet("PATH", value.nativePath(), QString(OsSpecificAspects::pathListSeparator(m_osType))); } @@ -66,7 +66,7 @@ void Environment::prependOrSetPath(const FilePath &value) QTC_CHECK(value.osType() == m_osType); if (value.isEmpty()) return; - prependOrSet("PATH", value.deviceLocalPath(), + prependOrSet("PATH", value.nativePath(), QString(OsSpecificAspects::pathListSeparator(m_osType))); } @@ -104,12 +104,12 @@ void Environment::prependOrSetLibrarySearchPath(const FilePath &value) switch (m_osType) { case OsTypeWindows: { const QChar sep = ';'; - prependOrSet("PATH", value.deviceLocalPath(), QString(sep)); + prependOrSet("PATH", value.nativePath(), QString(sep)); break; } case OsTypeMac: { const QString sep = ":"; - const QString nativeValue = value.deviceLocalPath(); + const QString nativeValue = value.nativePath(); prependOrSet("DYLD_LIBRARY_PATH", nativeValue, sep); prependOrSet("DYLD_FRAMEWORK_PATH", nativeValue, sep); break; @@ -117,7 +117,7 @@ void Environment::prependOrSetLibrarySearchPath(const FilePath &value) case OsTypeLinux: case OsTypeOtherUnix: { const QChar sep = ':'; - prependOrSet("LD_LIBRARY_PATH", value.deviceLocalPath(), QString(sep)); + prependOrSet("LD_LIBRARY_PATH", value.nativePath(), QString(sep)); break; } default: diff --git a/src/libs/utils/filepath.cpp b/src/libs/utils/filepath.cpp index 50526558e1e..57faa92c825 100644 --- a/src/libs/utils/filepath.cpp +++ b/src/libs/utils/filepath.cpp @@ -490,7 +490,7 @@ QString FilePath::toUserOutput() const /// \returns a QString to pass to target system native commands, without the device prefix. /// Converts the separators to the native format of the system /// this path belongs to. -QString FilePath::deviceLocalPath() const +QString FilePath::nativePath() const { QString data = m_data; if (osType() == OsTypeWindows) diff --git a/src/libs/utils/filepath.h b/src/libs/utils/filepath.h index 2a135ec1150..ab1f83d96fd 100644 --- a/src/libs/utils/filepath.h +++ b/src/libs/utils/filepath.h @@ -66,7 +66,6 @@ public: [[nodiscard]] static FilePath fromUrl(const QUrl &url); QString toUserOutput() const; - QString deviceLocalPath() const; QString toString() const; QVariant toVariant() const; QUrl toUrl() const; @@ -167,6 +166,7 @@ public: // on Windows and macOS. This is rarely needed. [[nodiscard]] FilePath normalizedPathName() const; + QString nativePath() const; QString shortNativePath() const; bool startsWithDriveLetter() const; diff --git a/src/libs/utils/winutils.cpp b/src/libs/utils/winutils.cpp index 6941c58c371..0724100dff3 100644 --- a/src/libs/utils/winutils.cpp +++ b/src/libs/utils/winutils.cpp @@ -163,7 +163,7 @@ QTCREATOR_UTILS_EXPORT bool is64BitWindowsBinary(const FilePath &binaryIn) # endif bool isAmd64 = false; DWORD binaryType = 0; - const QString binary = binaryIn.deviceLocalPath(); + const QString binary = binaryIn.nativePath(); bool success = GetBinaryTypeW(reinterpret_cast(binary.utf16()), &binaryType) != 0; if (success && binaryType == SCS_64BIT_BINARY) isAmd64=true;