Do not skip params with unknown paramtype ids

This is to give plugins a chance to migrate data over if they change their params.
pull/181/head
Michael Zanetti 2019-07-15 13:06:15 +02:00
parent 87db9dd4ec
commit 93bcad826c
1 changed files with 3 additions and 2 deletions

View File

@ -1008,9 +1008,10 @@ void DeviceManagerImplementation::loadConfiguredDevices()
foreach (const QString &paramTypeIdString, 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