Always initialize device settings params

pull/215/head
Michael Zanetti 2019-09-27 12:09:57 +02:00
parent 6aa624c261
commit c437ef7143
1 changed files with 7 additions and 0 deletions

View File

@ -1148,6 +1148,13 @@ void DeviceManagerImplementation::loadConfiguredDevices()
}
}
DeviceUtils::verifyParams(deviceClass.settingsTypes(), deviceSettings);
// Make sure all settings are around. if they aren't initialize with default values
foreach (const ParamType &settingsType, deviceClass.settingsTypes()) {
if (!deviceSettings.hasParam(settingsType.id())) {
deviceSettings.append(Param(settingsType.id(), settingsType.defaultValue().isValid() ? settingsType.defaultValue() : ""));
}
}
device->setSettings(deviceSettings);
settings.endGroup(); // Settings