forked from qt-creator/qt-creator
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:
@@ -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;
|
||||
}
|
||||
|
||||
|
@@ -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();
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user