diff options
author | Petr Mrázek <peterix@gmail.com> | 2016-04-10 16:10:47 +0200 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2016-05-01 00:00:24 +0200 |
commit | aa4842a91d35481264ae5a7c0ac17ea43610b600 (patch) | |
tree | d7c3d9b029322f1183d6c4bf6d54756672b0f6e9 /api | |
parent | b6d455a02bd338e9dc0faa09d4d8177ecd8d569a (diff) | |
download | MultiMC-aa4842a91d35481264ae5a7c0ac17ea43610b600.tar MultiMC-aa4842a91d35481264ae5a7c0ac17ea43610b600.tar.gz MultiMC-aa4842a91d35481264ae5a7c0ac17ea43610b600.tar.lz MultiMC-aa4842a91d35481264ae5a7c0ac17ea43610b600.tar.xz MultiMC-aa4842a91d35481264ae5a7c0ac17ea43610b600.zip |
NOISSUE make travis.ci shut up about fancy QJsonObject initialization in Wonko parser
Diffstat (limited to 'api')
-rw-r--r-- | api/logic/wonko/format/WonkoFormatV1.cpp | 40 |
1 files changed, 21 insertions, 19 deletions
diff --git a/api/logic/wonko/format/WonkoFormatV1.cpp b/api/logic/wonko/format/WonkoFormatV1.cpp index 363eebfb..a0ab220b 100644 --- a/api/logic/wonko/format/WonkoFormatV1.cpp +++ b/api/logic/wonko/format/WonkoFormatV1.cpp @@ -57,14 +57,16 @@ static void serializeCommonVersion(const WonkoVersion *version, QJsonObject &obj { if (ref.version().isEmpty()) { - requires.append(QJsonObject({{"uid", ref.uid()}})); + QJsonObject out; + out["uid"] = ref.uid(); + requires.append(out); } else { - requires.append(QJsonObject({ - {"uid", ref.uid()}, - {"version", ref.version()} - })); + QJsonObject out; + out["uid"] = ref.uid(); + out["version"] = ref.version(); + requires.append(out); } } @@ -117,15 +119,15 @@ QJsonObject WonkoFormatV1::serializeIndexInternal(const WonkoIndex *ptr) const QJsonArray index; for (const WonkoVersionListPtr &list : ptr->lists()) { - index.append(QJsonObject({ - {"uid", list->uid()}, - {"name", list->name()} - })); + QJsonObject out; + out["uid"] = list->uid(); + out["version"] = list->name(); + index.append(out); } - return QJsonObject({ - {"formatVersion", 1}, - {"index", index} - }); + QJsonObject out; + out["formatVersion"] = 1; + out["index"] = index; + return out; } QJsonObject WonkoFormatV1::serializeVersionInternal(const WonkoVersion *ptr) const { @@ -147,10 +149,10 @@ QJsonObject WonkoFormatV1::serializeVersionListInternal(const WonkoVersionList * serializeCommonVersion(version.get(), obj); versions.append(obj); } - return QJsonObject({ - {"formatVersion", 10}, - {"uid", ptr->uid()}, - {"name", ptr->name().isNull() ? QJsonValue() : ptr->name()}, - {"versions", versions} - }); + QJsonObject out; + out["formatVersion"] = 10; + out["uid"] = ptr->uid(); + out["name"] = ptr->name().isNull() ? QJsonValue() : ptr->name(); + out["versions"] = versions; + return out; } |