remove protection for auto device removal for now...

... as we need more fine grained control over this.
This commit is contained in:
Michael Zanetti 2017-10-05 13:00:51 +02:00
parent b0d707080b
commit 8c0ae4eff6
2 changed files with 6 additions and 5 deletions

View File

@ -146,10 +146,11 @@ QPair<DeviceManager::DeviceError, QList<RuleId> > GuhCore::removeConfiguredDevic
return QPair<DeviceManager::DeviceError, QList<RuleId> > (DeviceManager::DeviceErrorDeviceIsChild, QList<RuleId>()); return QPair<DeviceManager::DeviceError, QList<RuleId> > (DeviceManager::DeviceErrorDeviceIsChild, QList<RuleId>());
} }
if (device->autoCreated()) { // FIXME: Let's remove this for now. It will come back with more fine grained control, presumably introducing a RemoveMethod flag in the DeviceClass
qCWarning(dcDeviceManager) << "This device has been auto-created and cannot be deleted manually."; // if (device->autoCreated()) {
return QPair<DeviceManager::DeviceError, QList<RuleId> >(DeviceManager::DeviceErrorCreationMethodNotSupported, {}); // 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 // Check if this device has child devices
QList<Device *> devicesToRemove; QList<Device *> devicesToRemove;

View File

@ -1175,7 +1175,7 @@ void TestDevices::removeDevice_data()
QTest::newRow("Existing Device") << m_mockDeviceId << DeviceManager::DeviceErrorNoError; QTest::newRow("Existing Device") << m_mockDeviceId << DeviceManager::DeviceErrorNoError;
QTest::newRow("Not existing Device") << DeviceId::createDeviceId() << DeviceManager::DeviceErrorDeviceNotFound; 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() void TestDevices::removeDevice()