diff options
author | Petr Mrázek <peterix@gmail.com> | 2017-03-24 02:26:06 +0100 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2017-04-07 00:20:02 +0200 |
commit | da4ae1bc1ec74cdb4e75f4ebac30886ba4a1909c (patch) | |
tree | c6db08bd02bd991c2370ca62f43249afaf3fe156 /application | |
parent | 77f27a628f33a591f7562ca05c206ac604212443 (diff) | |
download | MultiMC-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 'application')
-rw-r--r-- | application/pages/VersionPage.cpp | 7 | ||||
-rw-r--r-- | application/pages/global/PackagesPage.cpp | 18 |
2 files changed, 13 insertions, 12 deletions
diff --git a/application/pages/VersionPage.cpp b/application/pages/VersionPage.cpp index 732a33eb..0608b2bf 100644 --- a/application/pages/VersionPage.cpp +++ b/application/pages/VersionPage.cpp @@ -43,6 +43,9 @@ #include "MultiMC.h" +#include <meta/Index.h> +#include <meta/VersionList.h> + class IconProxy : public QIdentityProxyModel { Q_OBJECT @@ -372,7 +375,7 @@ int VersionPage::doUpdate() void VersionPage::on_forgeBtn_clicked() { - auto vlist = ENV.getVersionList("net.minecraftforge"); + auto vlist = ENV.metadataIndex()->get("net.minecraftforge"); if(!vlist) { return; @@ -391,7 +394,7 @@ void VersionPage::on_forgeBtn_clicked() void VersionPage::on_liteloaderBtn_clicked() { - auto vlist = ENV.getVersionList("com.liteloader"); + auto vlist = ENV.metadataIndex()->get("com.liteloader"); if(!vlist) { return; diff --git a/application/pages/global/PackagesPage.cpp b/application/pages/global/PackagesPage.cpp index e4967532..e15ddbab 100644 --- a/application/pages/global/PackagesPage.cpp +++ b/application/pages/global/PackagesPage.cpp @@ -34,17 +34,15 @@ using namespace Meta; static QString formatRequires(const VersionPtr &version) { QStringList lines; - for (const Reference &ref : version->requires()) + auto & reqs = version->requires(); + auto iter = reqs.begin(); + while (iter != reqs.end()) { - const QString readable = ENV.metadataIndex()->hasUid(ref.uid()) ? ENV.metadataIndex()->get(ref.uid())->humanReadable() : ref.uid(); - if (ref.version().isEmpty()) - { - lines.append(readable); - } - else - { - lines.append(QString("%1 (%2)").arg(readable, ref.version())); - } + auto &uid = iter.key(); + auto &version = iter.value(); + const QString readable = ENV.metadataIndex()->hasUid(uid) ? ENV.metadataIndex()->get(uid)->humanReadable() : uid; + lines.append(QString("%1 (%2)").arg(readable, version)); + iter++; } return lines.join('\n'); } |