ProjectExplorer: Introduce device://<deviceid>/...

... to identify a device in a file path.

For use from the sdktool.

This is an addition to the pre-existing way to identify devices
using e.g. docker://<id> or ssh://<ip>/

Change-Id: Ice5481eab550b2fe39eda4c6d74d9c46fa6b6626
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2022-02-24 09:21:11 +01:00
parent 3ae6f41c3f
commit 1172eeb060

View File

@@ -366,6 +366,15 @@ bool DeviceManager::isLoaded() const
IDevice::ConstPtr DeviceManager::deviceForPath(const FilePath &path)
{
const QList<IDevice::Ptr> devices = instance()->d->deviceList();
if (path.scheme() == "device") {
for (const IDevice::Ptr &dev : devices) {
if (path.host() == dev->id().toString())
return dev;
}
return {};
}
for (const IDevice::Ptr &dev : devices) {
// TODO: ensure handlesFile is thread safe
if (dev->handlesFile(path))