ProjectExplorer: Implement (Docker)Device::exists(filePath)

While the original plan was to use more specific functions like
'isReadableFile' to cut down the number of accesses, it is
unrealistic to re-write all occurrences in reasonable time.
So make the basic building blocks accessible, too.

Change-Id: I2586ebd19e1e7ae2c884fd2a4180869421293e3a
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
hjk
2021-06-01 09:40:17 +02:00
parent 422409bf26
commit a7cd9bda3a
7 changed files with 36 additions and 1 deletions

View File

@@ -832,7 +832,10 @@ void FilePath::setHost(const QString &host)
/// FilePath exists.
bool FilePath::exists() const
{
QTC_ASSERT(!needsDevice(), return false);
if (needsDevice()) {
QTC_ASSERT(s_deviceHooks.exists, return false);
return s_deviceHooks.exists(*this);
}
return !isEmpty() && QFileInfo::exists(m_data);
}