forked from qt-creator/qt-creator
ProjectExplorer: Improve error reporting
Previously anytime a FilePath operation tried to access a device that does not have a DeviceFileAccess an error message would be thrown. This patch makes it possible to differentiate between the device not being found, and the device just not having a DeviceFileAccess interface. Also the error message in DeviceFileAccess::exists() was removed as its not an error to ask if something exists even if it does not. Change-Id: Ib8c2e08132159d0d97bcd049b59436eb17bdbacd Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -939,9 +939,9 @@ DeviceFileAccess *FilePath::fileAccess() const
|
||||
}
|
||||
|
||||
static DeviceFileAccess dummy;
|
||||
DeviceFileAccess *access = s_deviceHooks.fileAccess(*this);
|
||||
QTC_ASSERT(access, qDebug() << toString(); return &dummy);
|
||||
return access;
|
||||
const expected_str<DeviceFileAccess *> access = s_deviceHooks.fileAccess(*this);
|
||||
QTC_ASSERT_EXPECTED(access, return &dummy);
|
||||
return *access ? *access : &dummy;
|
||||
}
|
||||
|
||||
/*!
|
||||
|
||||
Reference in New Issue
Block a user