Fixed updates of view when simulated aircraft values are updated.

* renamed view to simulated aircraft view
* utility function for bool -> on/off
This commit is contained in:
Klaus Basan
2015-03-19 03:39:33 +01:00
parent 066515fb9b
commit a50e45e451
9 changed files with 69 additions and 38 deletions

View File

@@ -396,12 +396,12 @@ QJsonObject BlackMisc::getIncrementalObject(const QJsonObject &previousObject, c
QJsonObject BlackMisc::applyIncrementalObject(const QJsonObject &previousObject, const QJsonObject &incrementalObject)
{
QJsonObject currentObject = previousObject;
for(const auto &key : incrementalObject.keys())
for (const auto &key : incrementalObject.keys())
{
// If it is not an object, just insert the value
if (!incrementalObject.value(key).isObject())
{
currentObject.insert(key,incrementalObject.value(key));
currentObject.insert(key, incrementalObject.value(key));
}
else
{
@@ -411,3 +411,17 @@ QJsonObject BlackMisc::applyIncrementalObject(const QJsonObject &previousObject,
}
return currentObject;
}
QString BlackMisc::boolToOnOff(bool v, bool i18n)
{
Q_UNUSED(i18n);
return v ? "on" : "off";
}
QString BlackMisc::boolToYesNo(bool v, bool i18n)
{
Q_UNUSED(i18n);
return v ? "yes" : "no";
}