Docker: Properly map back DockerDevice::directoryEntries() result

Even though the file is accessible in the local path, not mapping
back loses its relation do the docker container used for further
decisions like FilePath::needsDevice().

Change-Id: I7c693d604364b9e42bf7310c072be0f33d149626
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2021-07-05 13:39:18 +02:00
parent 100c5f5c26
commit fd71cbf135

View File

@@ -1037,15 +1037,19 @@ FilePath DockerDevice::searchInPath(const FilePath &filePath) const
return mapToGlobalPath(FilePath::fromString(output)); return mapToGlobalPath(FilePath::fromString(output));
} }
QList<FilePath> DockerDevice::directoryEntries(const FilePath &filePath, FilePaths DockerDevice::directoryEntries(const FilePath &filePath,
const QStringList &nameFilters, const QStringList &nameFilters,
QDir::Filters filters, QDir::Filters filters,
QDir::SortFlags sort) const QDir::SortFlags sort) const
{ {
QTC_ASSERT(handlesFile(filePath), return {}); QTC_ASSERT(handlesFile(filePath), return {});
tryCreateLocalFileAccess(); tryCreateLocalFileAccess();
if (hasLocalFileAccess()) if (hasLocalFileAccess()) {
return mapToLocalAccess(filePath).dirEntries(nameFilters, filters, sort); const FilePaths entries = mapToLocalAccess(filePath).dirEntries(nameFilters, filters, sort);
return Utils::transform(entries, [this](const FilePath &entry) {
return mapFromLocalAccess(entry);
});
}
QTC_CHECK(false); // FIXME: Implement QTC_CHECK(false); // FIXME: Implement
return {}; return {};