Commit a90d96e3 authored by Aard's avatar Aard

[ssu] Prefer device-specific keys over variant keys

parent 32357ead
......@@ -443,10 +443,10 @@ void SsuDeviceInfo::setDeviceModel(QString model){
}
QVariant SsuDeviceInfo::value(const QString &key, const QVariant &value){
if (boardMappings->contains(deviceVariant()+"/"+key)){
return boardMappings->value(deviceVariant()+"/"+key);
} else if (boardMappings->contains(deviceModel()+"/"+key)){
if (boardMappings->contains(deviceModel()+"/"+key)){
return boardMappings->value(deviceModel()+"/"+key);
} else if (boardMappings->contains(deviceVariant()+"/"+key)){
return boardMappings->value(deviceVariant()+"/"+key);
}
return value;
......
......@@ -99,6 +99,10 @@ class SsuDeviceInfo: public QObject {
/**
* Return a value from an adaptation section. Returns an empty string
* or a given default value if key does not exist.
*
* If a device is marked as variant, and the requested key exists in a
* dedicated device section the key from the device section will get
* returned, otherwise the one from the variant.
*/
QVariant value(const QString &key, const QVariant &value=QVariant());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment