mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-05-05 09:45:44 +08:00
Ref T241, Ref T243, utility function toIncrementalJson for parts (adds the JSON attribute)
This commit is contained in:
@@ -31,6 +31,14 @@ namespace BlackMisc
|
|||||||
QStringLiteral(" on ground: ") % BlackMisc::boolToYesNo(m_isOnGround);
|
QStringLiteral(" on ground: ") % BlackMisc::boolToYesNo(m_isOnGround);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QJsonObject CAircraftParts::toIncrementalJson() const
|
||||||
|
{
|
||||||
|
QJsonObject json = this->toJson();
|
||||||
|
json.remove("is_full_data");
|
||||||
|
json.insert("is_full_data", QJsonValue(false));
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
|
||||||
CVariant CAircraftParts::propertyByIndex(const BlackMisc::CPropertyIndex &index) const
|
CVariant CAircraftParts::propertyByIndex(const BlackMisc::CPropertyIndex &index) const
|
||||||
{
|
{
|
||||||
if (index.isMyself()) { return CVariant::from(*this); }
|
if (index.isMyself()) { return CVariant::from(*this); }
|
||||||
|
|||||||
@@ -128,6 +128,9 @@ namespace BlackMisc
|
|||||||
//! \copydoc BlackMisc::Mixin::String::toQString
|
//! \copydoc BlackMisc::Mixin::String::toQString
|
||||||
QString convertToQString(bool i18n = false) const;
|
QString convertToQString(bool i18n = false) const;
|
||||||
|
|
||||||
|
//! Incremental JSON object
|
||||||
|
QJsonObject toIncrementalJson() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
CAircraftLights m_lights;
|
CAircraftLights m_lights;
|
||||||
CAircraftEngineList m_engines;
|
CAircraftEngineList m_engines;
|
||||||
|
|||||||
Reference in New Issue
Block a user