summaryrefslogtreecommitdiffstats
path: root/api/logic/meta/Version.cpp
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2017-03-24 02:26:06 +0100
committerPetr Mrázek <peterix@gmail.com>2017-04-07 00:20:02 +0200
commitda4ae1bc1ec74cdb4e75f4ebac30886ba4a1909c (patch)
treec6db08bd02bd991c2370ca62f43249afaf3fe156 /api/logic/meta/Version.cpp
parent77f27a628f33a591f7562ca05c206ac604212443 (diff)
downloadMultiMC-da4ae1bc1ec74cdb4e75f4ebac30886ba4a1909c.tar
MultiMC-da4ae1bc1ec74cdb4e75f4ebac30886ba4a1909c.tar.gz
MultiMC-da4ae1bc1ec74cdb4e75f4ebac30886ba4a1909c.tar.lz
MultiMC-da4ae1bc1ec74cdb4e75f4ebac30886ba4a1909c.tar.xz
MultiMC-da4ae1bc1ec74cdb4e75f4ebac30886ba4a1909c.zip
NOISSUE reimplement package dependencies
It is now stored as a hashmap There is also a parentUid to limit depsolving by encapsulating by version
Diffstat (limited to 'api/logic/meta/Version.cpp')
-rw-r--r--api/logic/meta/Version.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/api/logic/meta/Version.cpp b/api/logic/meta/Version.cpp
index fee7d049..af9d4f10 100644
--- a/api/logic/meta/Version.cpp
+++ b/api/logic/meta/Version.cpp
@@ -65,6 +65,10 @@ void Meta::Version::merge(const std::shared_ptr<BaseEntity> &other)
{
setRequires(version->m_requires);
}
+ if (m_parentUid != version->m_parentUid)
+ {
+ setParentUid(version->m_parentUid);
+ }
setData(version->m_data);
}
@@ -74,21 +78,30 @@ QString Meta::Version::localFilename() const
return m_uid + '/' + m_version + ".json";
}
+void Meta::Version::setParentUid(const QString& parentUid)
+{
+ m_parentUid = parentUid;
+ emit requiresChanged();
+}
+
void Meta::Version::setType(const QString &type)
{
m_type = type;
emit typeChanged();
}
+
void Meta::Version::setTime(const qint64 time)
{
m_time = time;
emit timeChanged();
}
-void Meta::Version::setRequires(const QVector<Reference> &requires)
+
+void Meta::Version::setRequires(const QHash<QString, QString> &requires)
{
m_requires = requires;
emit requiresChanged();
}
+
void Meta::Version::setData(const VersionFilePtr &data)
{
m_data = data;