From abdfce129eb33d6601eb476eed3e8a6d4a951b37 Mon Sep 17 00:00:00 2001 From: Michael Zanetti Date: Thu, 7 Nov 2019 11:37:11 +0100 Subject: [PATCH] Don't load devices if the plugin dropped support for it --- libnymea-core/devices/devicemanagerimplementation.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libnymea-core/devices/devicemanagerimplementation.cpp b/libnymea-core/devices/devicemanagerimplementation.cpp index 91ee8f5f..fe5b6945 100644 --- a/libnymea-core/devices/devicemanagerimplementation.cpp +++ b/libnymea-core/devices/devicemanagerimplementation.cpp @@ -1142,6 +1142,12 @@ void DeviceManagerImplementation::loadConfiguredDevices() continue; } + // Cross-check if this plugin still implements this device class + if (!plugin->supportedDevices().contains(deviceClass)) { + qCWarning(dcDeviceManager()) << "Not loading device" << deviceName << idString << "because plugin" << plugin->pluginName() << "has removed support for it."; + settings.endGroup(); // DeviceId + continue; + } Device *device = new Device(plugin, deviceClass, DeviceId(idString), this); device->m_autoCreated = settings.value("autoCreated").toBool(); device->setName(deviceName);