summaryrefslogtreecommitdiff
path: root/src/plugins/projectexplorer/devicesupport
diff options
context:
space:
mode:
authorTobias Hunger <tobias.hunger@digia.com>2014-08-01 13:06:21 +0200
committerTobias Hunger <tobias.hunger@digia.com>2014-09-05 13:21:33 +0200
commitac24fd027a17dcd0fa4f2029942c7301aace6cfc (patch)
tree9eb4b4abcfab46ddd1c3cead94efd27817f7cc5c /src/plugins/projectexplorer/devicesupport
parent592a28eecd78fdd1e32e1185ce0d5e881cde2c23 (diff)
downloadqt-creator-ac24fd027a17dcd0fa4f2029942c7301aace6cfc.tar.gz
IDevice: Add method to check whether a device is compatible with a kit
The default implementation just compares the device's type() with the device type Id from the Kit. Change-Id: I7e72737c0b322c3ee11aef6b3a4751bb91e0add0 Reviewed-by: Christian Kandeler <christian.kandeler@digia.com> Reviewed-by: Benjamin Zeller <benjamin.zeller@canonical.com>
Diffstat (limited to 'src/plugins/projectexplorer/devicesupport')
-rw-r--r--src/plugins/projectexplorer/devicesupport/idevice.cpp13
-rw-r--r--src/plugins/projectexplorer/devicesupport/idevice.h4
2 files changed, 17 insertions, 0 deletions
diff --git a/src/plugins/projectexplorer/devicesupport/idevice.cpp b/src/plugins/projectexplorer/devicesupport/idevice.cpp
index 53c1485ddf..e7fb9f47c3 100644
--- a/src/plugins/projectexplorer/devicesupport/idevice.cpp
+++ b/src/plugins/projectexplorer/devicesupport/idevice.cpp
@@ -31,6 +31,9 @@
#include "devicemanager.h"
#include "deviceprocesslist.h"
+#include "../kit.h"
+#include "../kitinformation.h"
+
#include <ssh/sshconnection.h>
#include <utils/portlist.h>
#include <utils/qtcassert.h>
@@ -239,6 +242,16 @@ Core::Id IDevice::id() const
return d->id;
}
+/*!
+ Tests whether a device can be compatible with the given kit. The default
+ implementation will match the device type specified in the kit against
+ the device's own type.
+*/
+bool IDevice::isCompatibleWith(const Kit *k) const
+{
+ return DeviceTypeKitInformation::deviceTypeId(k) == type();
+}
+
PortsGatheringMethod::Ptr IDevice::portsGatheringMethod() const
{
return PortsGatheringMethod::Ptr();
diff --git a/src/plugins/projectexplorer/devicesupport/idevice.h b/src/plugins/projectexplorer/devicesupport/idevice.h
index ddcc00876d..049650c41f 100644
--- a/src/plugins/projectexplorer/devicesupport/idevice.h
+++ b/src/plugins/projectexplorer/devicesupport/idevice.h
@@ -50,6 +50,8 @@ namespace ProjectExplorer {
class DeviceProcess;
class DeviceProcessList;
+class Kit;
+
namespace Internal { class IDevicePrivate; }
class IDeviceWidget;
@@ -121,6 +123,8 @@ public:
bool isAutoDetected() const;
Core::Id id() const;
+ virtual bool isCompatibleWith(const Kit *k) const;
+
virtual QString displayType() const = 0;
virtual IDeviceWidget *createWidget() = 0;
virtual QList<Core::Id> actionIds() const = 0;