diff options
author | Petr Mrázek <peterix@gmail.com> | 2017-03-12 16:00:06 +0100 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2017-04-07 00:20:01 +0200 |
commit | 8321187a20eec9871f327aa23f421e79dcfdd409 (patch) | |
tree | c765e3acdf9f01c27563e84d1fd4f27696a5996a /api/logic/meta/format/Format.cpp | |
parent | ab868df50eb6f9f3958bdc0a7ab9199dcdf46b3c (diff) | |
download | MultiMC-8321187a20eec9871f327aa23f421e79dcfdd409.tar MultiMC-8321187a20eec9871f327aa23f421e79dcfdd409.tar.gz MultiMC-8321187a20eec9871f327aa23f421e79dcfdd409.tar.lz MultiMC-8321187a20eec9871f327aa23f421e79dcfdd409.tar.xz MultiMC-8321187a20eec9871f327aa23f421e79dcfdd409.zip |
NOISSUE fix downloading of metadata files
Diffstat (limited to 'api/logic/meta/format/Format.cpp')
-rw-r--r-- | api/logic/meta/format/Format.cpp | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/api/logic/meta/format/Format.cpp b/api/logic/meta/format/Format.cpp index a3f9f730..e0fddb0b 100644 --- a/api/logic/meta/format/Format.cpp +++ b/api/logic/meta/format/Format.cpp @@ -39,46 +39,52 @@ void Format::parseIndex(const QJsonObject &obj, Index *ptr) { const int version = formatVersion(obj); switch (version) { - case 1: + case 0: ptr->merge(FormatV1().parseIndexInternal(obj)); break; default: throw ParseException(QObject::tr("Unknown formatVersion: %1").arg(version)); } } -void Format::parseVersion(const QJsonObject &obj, Version *ptr) + +void Format::parseVersionList(const QJsonObject &obj, VersionList *ptr) { const int version = formatVersion(obj); switch (version) { - case 1: - ptr->merge(FormatV1().parseVersionInternal(obj)); + case 0: + ptr->merge(FormatV1().parseVersionListInternal(obj)); break; default: throw ParseException(QObject::tr("Unknown formatVersion: %1").arg(version)); } } -void Format::parseVersionList(const QJsonObject &obj, VersionList *ptr) + +void Format::parseVersion(const QJsonObject &obj, Version *ptr) { const int version = formatVersion(obj); switch (version) { - case 10: - ptr->merge(FormatV1().parseVersionListInternal(obj)); + case 0: + ptr->merge(FormatV1().parseVersionInternal(obj)); break; default: throw ParseException(QObject::tr("Unknown formatVersion: %1").arg(version)); } } + QJsonObject Format::serializeIndex(const Index *ptr) { return FormatV1().serializeIndexInternal(ptr); } -QJsonObject Format::serializeVersion(const Version *ptr) -{ - return FormatV1().serializeVersionInternal(ptr); -} + QJsonObject Format::serializeVersionList(const VersionList *ptr) { return FormatV1().serializeVersionListInternal(ptr); } + +QJsonObject Format::serializeVersion(const Version *ptr) +{ + return FormatV1().serializeVersionInternal(ptr); +} + } |