don't create new mock auto devices if we already have one

Fixes #21
pull/135/head
Michael Zanetti 2014-07-31 01:17:35 +02:00
parent 7fb111de1e
commit 8a90e7153d
1 changed files with 6 additions and 0 deletions

View File

@ -265,6 +265,12 @@ void DevicePluginMock::deviceRemoved(Device *device)
void DevicePluginMock::startMonitoringAutoDevices()
{
foreach (Device *device, myDevices()) {
if (device->deviceClassId() == mockDeviceAutoClassId) {
return; // We already have a Auto Mock device... do nothing.
}
}
DeviceDescriptor mockDescriptor(mockDeviceAutoClassId, "Mock Device (Auto created)");
ParamList params;