Utils: Rename FilePath::deviceLocalPath() to nativePath()

Change-Id: Id2b2b7d54a536d569c6dc717365ee28421e2b56b
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
hjk
2021-11-10 16:19:25 +01:00
parent 40c04a4fe4
commit 3fd1122759
4 changed files with 8 additions and 8 deletions

View File

@@ -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:

View File

@@ -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)

View File

@@ -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;

View File

@@ -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<const TCHAR*>(binary.utf16()), &binaryType) != 0;
if (success && binaryType == SCS_64BIT_BINARY)
isAmd64=true;