forked from qt-creator/qt-creator
Utils: Add FilePath::isSymLink
Needed to fix GenericUploadStep handle the device->device case. Change-Id: I551ac0957879e5b8737c22fa823d8b2e6bec0b5e Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -82,6 +82,13 @@ bool DeviceFileAccess::isDirectory(const FilePath &filePath) const
|
||||
return false;
|
||||
}
|
||||
|
||||
bool DeviceFileAccess::isSymLink(const FilePath &filePath) const
|
||||
{
|
||||
Q_UNUSED(filePath)
|
||||
QTC_CHECK(false);
|
||||
return false;
|
||||
}
|
||||
|
||||
bool DeviceFileAccess::ensureWritableDirectory(const FilePath &filePath) const
|
||||
{
|
||||
if (isWritableDirectory(filePath))
|
||||
@@ -317,6 +324,12 @@ bool DesktopDeviceFileAccess::isDirectory(const FilePath &filePath) const
|
||||
return fi.isDir();
|
||||
}
|
||||
|
||||
bool DesktopDeviceFileAccess::isSymLink(const FilePath &filePath) const
|
||||
{
|
||||
const QFileInfo fi(filePath.path());
|
||||
return fi.isSymLink();
|
||||
}
|
||||
|
||||
bool DesktopDeviceFileAccess::ensureWritableDirectory(const FilePath &filePath) const
|
||||
{
|
||||
const QFileInfo fi(filePath.path());
|
||||
@@ -656,6 +669,12 @@ bool UnixDeviceFileAccess::isDirectory(const FilePath &filePath) const
|
||||
return runInShellSuccess("test", {"-d", path});
|
||||
}
|
||||
|
||||
bool UnixDeviceFileAccess::isSymLink(const FilePath &filePath) const
|
||||
{
|
||||
const QString path = filePath.path();
|
||||
return runInShellSuccess("test", {"-h", path});
|
||||
}
|
||||
|
||||
bool UnixDeviceFileAccess::ensureExistingFile(const FilePath &filePath) const
|
||||
{
|
||||
const QString path = filePath.path();
|
||||
|
||||
Reference in New Issue
Block a user