Utils: Be a bit more informative in failing FilePath accesses

Change-Id: I2e30998d2d5cd3159b28996d1102c65cbb9ad03b
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
hjk
2022-12-14 08:27:35 +01:00
parent 8e8afd3cf6
commit 9bac0d7f4c
2 changed files with 3 additions and 3 deletions

View File

@@ -873,7 +873,7 @@ DeviceFileAccess *FilePath::fileAccess() const
static DeviceFileAccess dummy;
DeviceFileAccess *access = s_deviceHooks.fileAccess(*this);
QTC_ASSERT(access, return &dummy);
QTC_ASSERT(access, qDebug() << toString(); return &dummy);
return access;
}

View File

@@ -418,13 +418,13 @@ DeviceManager::DeviceManager(bool isInstance) : d(std::make_unique<DeviceManager
if (!filePath.needsDevice())
return DesktopDeviceFileAccess::instance();
auto device = DeviceManager::deviceForPath(filePath);
QTC_ASSERT(device, return nullptr);
QTC_ASSERT(device, qDebug() << filePath.toString(); return nullptr);
return device->fileAccess();
};
deviceHooks.environment = [](const FilePath &filePath) {
auto device = DeviceManager::deviceForPath(filePath);
QTC_ASSERT(device, return Environment{});
QTC_ASSERT(device, qDebug() << filePath.toString(); return Environment{});
return device->systemEnvironment();
};