forked from qt-creator/qt-creator
Device: Add method to get the index of a idevice
Add a method to get the index of an IDevice * in the DeviceManager. Change-Id: Icf02c8a682185ebe9ea68fd4edb026d1c8335112 Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
This commit is contained in:
@@ -405,6 +405,11 @@ IDevice::Id DeviceManager::internalId(const IDevice::ConstPtr &device) const
|
||||
return device ? device->internalId() : IDevice::invalidId();
|
||||
}
|
||||
|
||||
int DeviceManager::indexOf(const IDevice *device) const
|
||||
{
|
||||
return indexForInternalId(device->internalId());
|
||||
}
|
||||
|
||||
void DeviceManager::ensureOneDefaultDevicePerType()
|
||||
{
|
||||
foreach (const IDevice::Ptr &device, d->devices) {
|
||||
|
@@ -64,6 +64,8 @@ public:
|
||||
bool hasDevice(const QString &name) const;
|
||||
IDevice::Id internalId(const IDevice::ConstPtr &device) const;
|
||||
|
||||
int indexOf(const IDevice *device) const;
|
||||
|
||||
void addDevice(const IDevice::Ptr &device);
|
||||
void removeDevice(int index);
|
||||
|
||||
|
Reference in New Issue
Block a user