From 1172eeb06090b1268712039a1c1cae802fce3494 Mon Sep 17 00:00:00 2001 From: hjk Date: Thu, 24 Feb 2022 09:21:11 +0100 Subject: [PATCH] ProjectExplorer: Introduce device:///... ... 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:// or ssh:/// Change-Id: Ice5481eab550b2fe39eda4c6d74d9c46fa6b6626 Reviewed-by: Jarek Kobus Reviewed-by: Reviewed-by: Christian Stenger --- .../projectexplorer/devicesupport/devicemanager.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/plugins/projectexplorer/devicesupport/devicemanager.cpp b/src/plugins/projectexplorer/devicesupport/devicemanager.cpp index 256b93b6157..2f33c106d7e 100644 --- a/src/plugins/projectexplorer/devicesupport/devicemanager.cpp +++ b/src/plugins/projectexplorer/devicesupport/devicemanager.cpp @@ -366,6 +366,15 @@ bool DeviceManager::isLoaded() const IDevice::ConstPtr DeviceManager::deviceForPath(const FilePath &path) { const QList 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))