From 93bcad826ce800b401bfe31eb0e3a72235fcde24 Mon Sep 17 00:00:00 2001 From: Michael Zanetti Date: Mon, 15 Jul 2019 13:06:15 +0200 Subject: [PATCH] Do not skip params with unknown paramtype ids This is to give plugins a chance to migrate data over if they change their params. --- libnymea-core/devices/devicemanagerimplementation.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libnymea-core/devices/devicemanagerimplementation.cpp b/libnymea-core/devices/devicemanagerimplementation.cpp index cea71001..e9c5e9c0 100644 --- a/libnymea-core/devices/devicemanagerimplementation.cpp +++ b/libnymea-core/devices/devicemanagerimplementation.cpp @@ -1008,9 +1008,10 @@ void DeviceManagerImplementation::loadConfiguredDevices() foreach (const QString ¶mTypeIdString, settings.childGroups()) { ParamTypeId paramTypeId(paramTypeIdString); ParamType paramType = deviceClass.paramTypes().findById(paramTypeId); + QVariant defaultValue; if (!paramType.isValid()) { - qCWarning(dcDeviceManager()) << "Not loading Param for device" << device << "because the ParamType for the saved Param" << ParamTypeId(paramTypeIdString).toString() << "could not be found."; - continue; + // NOTE: We're not skipping unknown parameters to give plugins a chance to still access old values if they change their config and migrate things over. + qCWarning(dcDeviceManager()) << "Unknown param" << paramTypeIdString << "for" << device << ". ParamType could not be found in device class."; } // Note: since nymea 0.12.2