This commit is contained in:
2020-04-29 17:32:43 +03:00
parent ad374ea17e
commit 0ac382e628

View File

@@ -526,7 +526,7 @@ inline PICout operator <<(PICout s, const PIConfig::Entry & v) {s << v.value();
template<typename T> template<typename T>
T readDeviceSetting(const PIString & name, const T & def, const PIConfig::Entry * em, const PIConfig::Entry * ep) { T readDeviceSetting(const PIString & name, const T & def, const PIConfig::Entry * em, const PIConfig::Entry * ep) {
PIVariant v = PIVariant::fromValue<T>(def); PIVariant v = PIVariant::fromValue<T>(def);
if (ep != 0) { if (ep) {
bool ex = false; bool ex = false;
v.setValueFromString(ep->getValue(name, def, &ex).toString()); v.setValueFromString(ep->getValue(name, def, &ex).toString());
if (ex) return v.value<T>(); if (ex) return v.value<T>();