diff --git a/src/plugins/debugger/debuggerrunconfigurationaspect.cpp b/src/plugins/debugger/debuggerrunconfigurationaspect.cpp index f317f5325c5..9db4aba5ca3 100644 --- a/src/plugins/debugger/debuggerrunconfigurationaspect.cpp +++ b/src/plugins/debugger/debuggerrunconfigurationaspect.cpp @@ -288,7 +288,7 @@ bool DebuggerRunConfigurationAspect::isQmlDebuggingSpinboxSuppressed() const ProjectExplorer::IDevice::ConstPtr dev = ProjectExplorer::DeviceKitInformation::device(k); if (dev.isNull()) return false; - return dev->portsGatheringMethod().isNull(); // We know the free ports... + return dev->canAutoDetectPorts(); } QString DebuggerRunConfigurationAspect::displayName() const diff --git a/src/plugins/projectexplorer/devicesupport/desktopdevice.cpp b/src/plugins/projectexplorer/devicesupport/desktopdevice.cpp index d05f64a64fc..4eb851a5c4a 100644 --- a/src/plugins/projectexplorer/devicesupport/desktopdevice.cpp +++ b/src/plugins/projectexplorer/devicesupport/desktopdevice.cpp @@ -90,6 +90,11 @@ void DesktopDevice::executeAction(Core::Id actionId, QWidget *parent) const Q_UNUSED(parent); } +bool DesktopDevice::canAutoDetectPorts() const +{ + return true; +} + bool DesktopDevice::canCreateProcessModel() const { return true; diff --git a/src/plugins/projectexplorer/devicesupport/desktopdevice.h b/src/plugins/projectexplorer/devicesupport/desktopdevice.h index 892d234283d..58f86d191ae 100644 --- a/src/plugins/projectexplorer/devicesupport/desktopdevice.h +++ b/src/plugins/projectexplorer/devicesupport/desktopdevice.h @@ -50,6 +50,7 @@ public: QList actionIds() const; QString displayNameForActionId(Core::Id actionId) const; void executeAction(Core::Id actionId, QWidget *parent = 0) const; + bool canAutoDetectPorts() const; bool canCreateProcessModel() const; DeviceProcessList *createProcessListModel(QObject *parent) const; diff --git a/src/plugins/projectexplorer/devicesupport/idevice.h b/src/plugins/projectexplorer/devicesupport/idevice.h index a7817b57c30..3d54eb48ca4 100644 --- a/src/plugins/projectexplorer/devicesupport/idevice.h +++ b/src/plugins/projectexplorer/devicesupport/idevice.h @@ -112,6 +112,9 @@ public: virtual void executeAction(Core::Id actionId, QWidget *parent = 0) const = 0; virtual DeviceProcessSupport::Ptr processSupport() const; + // Devices that can auto detect ports need not return a ports gathering method. Such devices can + // obtain a free port on demand. eg: Desktop device. + virtual bool canAutoDetectPorts() const { return false; } virtual PortsGatheringMethod::Ptr portsGatheringMethod() const; virtual bool canCreateProcessModel() const { return false; } virtual DeviceProcessList *createProcessListModel(QObject *parent = 0) const; diff --git a/src/plugins/remotelinux/linuxdevice.cpp b/src/plugins/remotelinux/linuxdevice.cpp index 572f87497b0..70796e54cd4 100644 --- a/src/plugins/remotelinux/linuxdevice.cpp +++ b/src/plugins/remotelinux/linuxdevice.cpp @@ -249,6 +249,11 @@ DeviceProcessSupport::Ptr LinuxDevice::processSupport() const return DeviceProcessSupport::Ptr(new LinuxDeviceProcessSupport); } +bool LinuxDevice::canAutoDetectPorts() const +{ + return true; +} + PortsGatheringMethod::Ptr LinuxDevice::portsGatheringMethod() const { return LinuxPortsGatheringMethod::Ptr(new LinuxPortsGatheringMethod); diff --git a/src/plugins/remotelinux/linuxdevice.h b/src/plugins/remotelinux/linuxdevice.h index fbcafb9a506..0daa95e58e8 100644 --- a/src/plugins/remotelinux/linuxdevice.h +++ b/src/plugins/remotelinux/linuxdevice.h @@ -69,6 +69,7 @@ public: ProjectExplorer::IDevice::Ptr clone() const; ProjectExplorer::DeviceProcessSupport::Ptr processSupport() const; + bool canAutoDetectPorts() const; ProjectExplorer::PortsGatheringMethod::Ptr portsGatheringMethod() const; bool canCreateProcessModel() const { return true; } ProjectExplorer::DeviceProcessList *createProcessListModel(QObject *parent) const;