diff options
author | Petr Mrázek <peterix@gmail.com> | 2017-04-06 23:30:18 +0200 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2017-04-07 00:20:02 +0200 |
commit | 643d74f66c2b22660264a393d5c3fa38f68a5d59 (patch) | |
tree | acd7387bdd6599aa1ecb8eb71f8d0d9a03c694c7 /api/logic/meta/JsonFormat.cpp | |
parent | f565798650b453ed8c94422096d9b37ba81ebf3e (diff) | |
download | MultiMC-643d74f66c2b22660264a393d5c3fa38f68a5d59.tar MultiMC-643d74f66c2b22660264a393d5c3fa38f68a5d59.tar.gz MultiMC-643d74f66c2b22660264a393d5c3fa38f68a5d59.tar.lz MultiMC-643d74f66c2b22660264a393d5c3fa38f68a5d59.tar.xz MultiMC-643d74f66c2b22660264a393d5c3fa38f68a5d59.zip |
NOISSUE implement recommended versions using the new JSON format
Diffstat (limited to 'api/logic/meta/JsonFormat.cpp')
-rw-r--r-- | api/logic/meta/JsonFormat.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/api/logic/meta/JsonFormat.cpp b/api/logic/meta/JsonFormat.cpp index 8a063f48..1638105a 100644 --- a/api/logic/meta/JsonFormat.cpp +++ b/api/logic/meta/JsonFormat.cpp @@ -52,6 +52,7 @@ static VersionPtr parseCommonVersion(const QString &uid, const QJsonObject &obj) version->setTime(QDateTime::fromString(requireString(obj, "releaseTime"), Qt::ISODate).toMSecsSinceEpoch() / 1000); version->setType(ensureString(obj, "type", QString())); version->setParentUid(ensureString(obj, "parentUid", QString())); + version->setRecommended(ensureBoolean(obj, "recommended", false)); if(obj.contains("requires")) { QHash<QString, QString> requires; @@ -87,7 +88,9 @@ static BaseEntity::Ptr parseVersionListInternal(const QJsonObject &obj) versions.reserve(versionsRaw.size()); std::transform(versionsRaw.begin(), versionsRaw.end(), std::back_inserter(versions), [uid](const QJsonObject &vObj) { - return parseCommonVersion(uid, vObj); + auto version = parseCommonVersion(uid, vObj); + version->setProvidesRecommendations(); + return version; }); VersionListPtr list = std::make_shared<VersionList>(uid); |