mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-30 11:55:35 +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);
|
||||
}
|
||||
|
||||
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
|
||||
{
|
||||
if (index.isMyself()) { return CVariant::from(*this); }
|
||||
|
||||
@@ -128,6 +128,9 @@ namespace BlackMisc
|
||||
//! \copydoc BlackMisc::Mixin::String::toQString
|
||||
QString convertToQString(bool i18n = false) const;
|
||||
|
||||
//! Incremental JSON object
|
||||
QJsonObject toIncrementalJson() const;
|
||||
|
||||
private:
|
||||
CAircraftLights m_lights;
|
||||
CAircraftEngineList m_engines;
|
||||
|
||||
Reference in New Issue
Block a user