summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhjk <hjk@qt.io>2022-02-24 09:21:11 +0100
committerhjk <hjk@qt.io>2022-02-24 14:27:57 +0000
commit1172eeb06090b1268712039a1c1cae802fce3494 (patch)
treeaf1c3af0b21d6e29aa1f12d3c3e0550688fca49c
parent3ae6f41c3f9a6b5cafe05e854b12b932fe8ade6c (diff)
downloadqt-creator-1172eeb06090b1268712039a1c1cae802fce3494.tar.gz
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>
-rw-r--r--src/plugins/projectexplorer/devicesupport/devicemanager.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/plugins/projectexplorer/devicesupport/devicemanager.cpp b/src/plugins/projectexplorer/devicesupport/devicemanager.cpp
index 256b93b615..2f33c106d7 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<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))