Do not skip params with unknown paramtype ids

This is to give plugins a chance to migrate data over if they change their params.
This commit is contained in:
Michael Zanetti 2019-07-15 13:06:15 +02:00
parent 87db9dd4ec
commit 93bcad826c

View File

@ -1008,9 +1008,10 @@ void DeviceManagerImplementation::loadConfiguredDevices()
foreach (const QString &paramTypeIdString, settings.childGroups()) { foreach (const QString &paramTypeIdString, settings.childGroups()) {
ParamTypeId paramTypeId(paramTypeIdString); ParamTypeId paramTypeId(paramTypeIdString);
ParamType paramType = deviceClass.paramTypes().findById(paramTypeId); ParamType paramType = deviceClass.paramTypes().findById(paramTypeId);
QVariant defaultValue;
if (!paramType.isValid()) { 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."; // 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.
continue; qCWarning(dcDeviceManager()) << "Unknown param" << paramTypeIdString << "for" << device << ". ParamType could not be found in device class.";
} }
// Note: since nymea 0.12.2 // Note: since nymea 0.12.2