diff options
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); +} + } |