From 8c0ae4eff60fba723c34846fd76111e4fb577a58 Mon Sep 17 00:00:00 2001 From: Michael Zanetti Date: Thu, 5 Oct 2017 13:00:51 +0200 Subject: [PATCH] remove protection for auto device removal for now... ... as we need more fine grained control over this. --- libguh-core/guhcore.cpp | 9 +++++---- tests/auto/devices/testdevices.cpp | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/libguh-core/guhcore.cpp b/libguh-core/guhcore.cpp index 63337953..e43d6b78 100644 --- a/libguh-core/guhcore.cpp +++ b/libguh-core/guhcore.cpp @@ -146,10 +146,11 @@ QPair > GuhCore::removeConfiguredDevic return QPair > (DeviceManager::DeviceErrorDeviceIsChild, QList()); } - if (device->autoCreated()) { - qCWarning(dcDeviceManager) << "This device has been auto-created and cannot be deleted manually."; - return QPair >(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::DeviceErrorCreationMethodNotSupported, {}); +// } // Check if this device has child devices QList devicesToRemove; diff --git a/tests/auto/devices/testdevices.cpp b/tests/auto/devices/testdevices.cpp index 0eb80b7b..15547289 100644 --- a/tests/auto/devices/testdevices.cpp +++ b/tests/auto/devices/testdevices.cpp @@ -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()