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/Version.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/Version.cpp')
-rw-r--r-- | api/logic/meta/Version.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/api/logic/meta/Version.cpp b/api/logic/meta/Version.cpp index 2a8e1780..338e180b 100644 --- a/api/logic/meta/Version.cpp +++ b/api/logic/meta/Version.cpp @@ -53,6 +53,13 @@ void Meta::Version::parse(const QJsonObject& obj) void Meta::Version::merge(const std::shared_ptr<BaseEntity> &other) { VersionPtr version = std::dynamic_pointer_cast<Version>(other); + if(version->m_providesRecommendations) + { + if(m_recommended != version->m_recommended) + { + setRecommended(version->m_recommended); + } + } if (m_type != version->m_type) { setType(version->m_type); @@ -107,3 +114,12 @@ void Meta::Version::setData(const VersionFilePtr &data) m_data = data; } +void Meta::Version::setProvidesRecommendations() +{ + m_providesRecommendations = true; +} + +void Meta::Version::setRecommended(bool recommended) +{ + m_recommended = recommended; +} |