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:
Marcus Tillmanns
2022-12-06 08:59:18 +01:00
parent ad2013eee5
commit aee7afd50b
4 changed files with 9 additions and 7 deletions

View File

@@ -269,7 +269,7 @@ class QTCREATOR_UTILS_EXPORT DeviceFileHooks
public:
static DeviceFileHooks &instance();
std::function<DeviceFileAccess *(const FilePath &)> fileAccess;
std::function<expected_str<DeviceFileAccess *>(const FilePath &)> fileAccess;
std::function<QString(const FilePath &)> deviceDisplayName;
std::function<bool(const FilePath &, const FilePath &)> ensureReachable;
std::function<Environment(const FilePath &)> environment;