remove protection for auto device removal for now...
... as we need more fine grained control over this.
This commit is contained in:
parent
b0d707080b
commit
8c0ae4eff6
@ -146,10 +146,11 @@ QPair<DeviceManager::DeviceError, QList<RuleId> > GuhCore::removeConfiguredDevic
|
||||
return QPair<DeviceManager::DeviceError, QList<RuleId> > (DeviceManager::DeviceErrorDeviceIsChild, QList<RuleId>());
|
||||
}
|
||||
|
||||
if (device->autoCreated()) {
|
||||
qCWarning(dcDeviceManager) << "This device has been auto-created and cannot be deleted manually.";
|
||||
return QPair<DeviceManager::DeviceError, QList<RuleId> >(DeviceManager::DeviceErrorCreationMethodNotSupported, {});
|
||||
}
|
||||
// FIXME: Let's remove this for now. It will come back with more fine grained control, presumably introducing a RemoveMethod flag in the DeviceClass
|
||||
// if (device->autoCreated()) {
|
||||
// qCWarning(dcDeviceManager) << "This device has been auto-created and cannot be deleted manually.";
|
||||
// return QPair<DeviceManager::DeviceError, QList<RuleId> >(DeviceManager::DeviceErrorCreationMethodNotSupported, {});
|
||||
// }
|
||||
|
||||
// Check if this device has child devices
|
||||
QList<Device *> devicesToRemove;
|
||||
|
||||
@ -1175,7 +1175,7 @@ void TestDevices::removeDevice_data()
|
||||
|
||||
QTest::newRow("Existing Device") << m_mockDeviceId << DeviceManager::DeviceErrorNoError;
|
||||
QTest::newRow("Not existing Device") << DeviceId::createDeviceId() << DeviceManager::DeviceErrorDeviceNotFound;
|
||||
QTest::newRow("Auto device") << m_mockDeviceAutoId << DeviceManager::DeviceErrorCreationMethodNotSupported;
|
||||
// QTest::newRow("Auto device") << m_mockDeviceAutoId << DeviceManager::DeviceErrorCreationMethodNotSupported;
|
||||
}
|
||||
|
||||
void TestDevices::removeDevice()
|
||||
|
||||
Reference in New Issue
Block a user