summaryrefslogtreecommitdiffstats
path: root/api/logic/meta/VersionList.cpp
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2017-12-29 00:37:14 +0100
committerPetr Mrázek <peterix@gmail.com>2017-12-29 00:37:14 +0100
commit719f3e863a2bdbaeaba37e837e0f6b75de124e6c (patch)
treebff005dd7e36b08d355bfec58742d44265fc0dd6 /api/logic/meta/VersionList.cpp
parent50ca6cbb4daaa4acd300defc6b7ecc7ccb46cebf (diff)
downloadMultiMC-719f3e863a2bdbaeaba37e837e0f6b75de124e6c.tar
MultiMC-719f3e863a2bdbaeaba37e837e0f6b75de124e6c.tar.gz
MultiMC-719f3e863a2bdbaeaba37e837e0f6b75de124e6c.tar.lz
MultiMC-719f3e863a2bdbaeaba37e837e0f6b75de124e6c.tar.xz
MultiMC-719f3e863a2bdbaeaba37e837e0f6b75de124e6c.zip
NOISSUE add versioning to component metadata format and use it
Diffstat (limited to 'api/logic/meta/VersionList.cpp')
-rw-r--r--api/logic/meta/VersionList.cpp26
1 files changed, 4 insertions, 22 deletions
diff --git a/api/logic/meta/VersionList.cpp b/api/logic/meta/VersionList.cpp
index 4963f235..66dc9fd1 100644
--- a/api/logic/meta/VersionList.cpp
+++ b/api/logic/meta/VersionList.cpp
@@ -76,20 +76,17 @@ QVariant VersionList::data(const QModelIndex &index, int role) const
return version->version();
case ParentVersionRole:
{
- auto parentUid = this->parentUid();
- if(parentUid.isEmpty())
- {
- return QVariant();
- }
+ // FIXME: HACK: this should be generic and be replaced by something else. Anything that is a hard 'equals' dep is a 'parent uid'.
auto & reqs = version->requires();
- auto iter = std::find_if(reqs.begin(), reqs.end(), [&parentUid](const Require & req)
+ auto iter = std::find_if(reqs.begin(), reqs.end(), [](const Require & req)
{
- return req.uid == parentUid;
+ return req.uid == "net.minecraft";
});
if (iter != reqs.end())
{
return (*iter).equalsVersion;
}
+ return QVariant();
}
case TypeRole: return version->type();
@@ -196,11 +193,6 @@ void VersionList::mergeFromIndex(const VersionListPtr &other)
{
setName(other->m_name);
}
-
- if(m_parentUid != other->m_parentUid)
- {
- setParentUid(other->m_parentUid);
- }
}
void VersionList::merge(const VersionListPtr &other)
@@ -210,11 +202,6 @@ void VersionList::merge(const VersionListPtr &other)
setName(other->m_name);
}
- if(m_parentUid != other->m_parentUid)
- {
- setParentUid(other->m_parentUid);
- }
-
// TODO: do not reset the whole model. maybe?
beginResetModel();
m_versions.clear();
@@ -256,8 +243,3 @@ BaseVersionPtr VersionList::getRecommended() const
}
}
-
-void Meta::VersionList::setParentUid(const QString& parentUid)
-{
- m_parentUid = parentUid;
-}