forked from qt-creator/qt-creator
Utils: Add FilePath::symLinkTarget
And implement it for the docker device. This replaces the previous unused and not really implemented FilePath::resolveSymLinkTarget. Change-Id: I9dcb4f8276dbb88b21959276da0d50135742fba0 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -1002,6 +1002,22 @@ QDateTime DockerDevice::lastModified(const FilePath &filePath) const
|
||||
return {};
|
||||
}
|
||||
|
||||
FilePath DockerDevice::symLinkTarget(const FilePath &filePath) const
|
||||
{
|
||||
QTC_ASSERT(handlesFile(filePath), return {});
|
||||
tryCreateLocalFileAccess();
|
||||
if (hasLocalFileAccess()) {
|
||||
const FilePath localAccess = mapToLocalAccess(filePath);
|
||||
const FilePath target = localAccess.symLinkTarget();
|
||||
LOG("SymLinkTarget? " << filePath.toUserOutput() << localAccess.toUserOutput() << target);
|
||||
if (target.isEmpty())
|
||||
return {};
|
||||
return mapToGlobalPath(target);
|
||||
}
|
||||
QTC_CHECK(false);
|
||||
return {};
|
||||
}
|
||||
|
||||
FilePath DockerDevice::searchInPath(const FilePath &filePath) const
|
||||
{
|
||||
const QString path = filePath.path();
|
||||
|
||||
Reference in New Issue
Block a user