forked from qt-creator/qt-creator
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:
@@ -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))
|
||||
|
Reference in New Issue
Block a user