config
This commit is contained in:
@@ -526,15 +526,13 @@ inline PICout operator <<(PICout s, const PIConfig::Entry & v) {s << v.value();
|
||||
template<typename T>
|
||||
T readDeviceSetting(const PIString & name, const T & def, const PIConfig::Entry * em, const PIConfig::Entry * ep) {
|
||||
PIVariant v = PIVariant::fromValue<T>(def);
|
||||
if (ep) {
|
||||
if (ep != 0) {
|
||||
bool ex = false;
|
||||
PIString sv = ep->getValue(name, def, &ex).toString();
|
||||
if (!ex)
|
||||
return def;
|
||||
v.setValueFromString(sv);
|
||||
return v.value<T>();
|
||||
v.setValueFromString(ep->getValue(name, def, &ex).toString());
|
||||
if (ex) return v.value<T>();
|
||||
}
|
||||
return def;
|
||||
v.setValueFromString(em->getValue(name, def).toString());
|
||||
return v.value<T>();
|
||||
}
|
||||
|
||||
#endif // PICONFIG_H
|
||||
|
||||
Reference in New Issue
Block a user