summaryrefslogtreecommitdiffstats
path: root/application
diff options
context:
space:
mode:
Diffstat (limited to 'application')
-rw-r--r--application/MultiMC.cpp22
-rw-r--r--application/MultiMC.h6
-rw-r--r--application/pages/VersionPage.cpp33
3 files changed, 16 insertions, 45 deletions
diff --git a/application/MultiMC.cpp b/application/MultiMC.cpp
index 98b73a6e..942b1d93 100644
--- a/application/MultiMC.cpp
+++ b/application/MultiMC.cpp
@@ -42,8 +42,6 @@
#include "icons/IconList.h"
//FIXME: get rid of this
#include "minecraft/legacy/LwjglVersionList.h"
-#include "minecraft/liteloader/LiteLoaderVersionList.h"
-#include "minecraft/forge/ForgeVersionList.h"
#include "net/HttpMetaCache.h"
#include "net/URLConstants.h"
@@ -868,26 +866,6 @@ std::shared_ptr<LWJGLVersionList> MultiMC::lwjgllist()
return m_lwjgllist;
}
-std::shared_ptr<ForgeVersionList> MultiMC::forgelist()
-{
- if (!m_forgelist)
- {
- m_forgelist.reset(new ForgeVersionList());
- ENV.registerVersionList("net.minecraftforge", m_forgelist);
- }
- return m_forgelist;
-}
-
-std::shared_ptr<LiteLoaderVersionList> MultiMC::liteloaderlist()
-{
- if (!m_liteloaderlist)
- {
- m_liteloaderlist.reset(new LiteLoaderVersionList());
- ENV.registerVersionList("com.mumfrey.liteloader", m_liteloaderlist);
- }
- return m_liteloaderlist;
-}
-
std::shared_ptr<JavaInstallList> MultiMC::javalist()
{
if (!m_javalist)
diff --git a/application/MultiMC.h b/application/MultiMC.h
index 8dc2e609..a9cbdec7 100644
--- a/application/MultiMC.h
+++ b/application/MultiMC.h
@@ -25,8 +25,6 @@ class InstanceList;
class MojangAccountList;
class IconList;
class QNetworkAccessManager;
-class ForgeVersionList;
-class LiteLoaderVersionList;
class JavaInstallList;
class UpdateChecker;
class BaseProfilerFactory;
@@ -96,8 +94,6 @@ public:
std::shared_ptr<TranslationsModel> translations();
std::shared_ptr<LWJGLVersionList> lwjgllist();
- std::shared_ptr<ForgeVersionList> forgelist();
- std::shared_ptr<LiteLoaderVersionList> liteloaderlist();
std::shared_ptr<JavaInstallList> javalist();
std::shared_ptr<InstanceList> instances() const
@@ -200,8 +196,6 @@ private:
std::shared_ptr<UpdateChecker> m_updateChecker;
std::shared_ptr<MojangAccountList> m_accounts;
std::shared_ptr<LWJGLVersionList> m_lwjgllist;
- std::shared_ptr<ForgeVersionList> m_forgelist;
- std::shared_ptr<LiteLoaderVersionList> m_liteloaderlist;
std::shared_ptr<JavaInstallList> m_javalist;
std::shared_ptr<TranslationsModel> m_translations;
std::shared_ptr<GenericPageProvider> m_globalSettingsProvider;
diff --git a/application/pages/VersionPage.cpp b/application/pages/VersionPage.cpp
index b90b3e43..42eb31de 100644
--- a/application/pages/VersionPage.cpp
+++ b/application/pages/VersionPage.cpp
@@ -36,10 +36,6 @@
#include <QUrl>
#include "minecraft/MinecraftProfile.h"
-#include "minecraft/forge/ForgeVersionList.h"
-#include "minecraft/forge/ForgeInstaller.h"
-#include "minecraft/liteloader/LiteLoaderVersionList.h"
-#include "minecraft/liteloader/LiteLoaderInstaller.h"
#include "minecraft/auth/MojangAccountList.h"
#include "minecraft/Mod.h"
#include "icons/IconList.h"
@@ -375,16 +371,18 @@ int VersionPage::doUpdate()
void VersionPage::on_forgeBtn_clicked()
{
- VersionSelectDialog vselect(MMC->forgelist().get(), tr("Select Forge version"), this);
+ auto vlist = ENV.getVersionList("net.minecraftforge");
+ if(!vlist)
+ {
+ return;
+ }
+ VersionSelectDialog vselect(vlist.get(), tr("Select Forge version"), this);
vselect.setExactFilter(BaseVersionList::ParentGameVersionRole, m_inst->currentVersionId());
- vselect.setEmptyString(tr("No Forge versions are currently available for Minecraft ") +
- m_inst->currentVersionId());
+ vselect.setEmptyString(tr("No Forge versions are currently available for Minecraft ") + m_inst->currentVersionId());
vselect.setEmptyErrorString(tr("Couldn't load or download the Forge version lists!"));
if (vselect.exec() && vselect.selectedVersion())
{
- ProgressDialog dialog(this);
- dialog.execWithTask(
- ForgeInstaller().createInstallTask(m_inst, vselect.selectedVersion(), this));
+ m_profile->installVersion(vselect.selectedVersion());
preselect(m_profile->rowCount(QModelIndex())-1);
m_container->refreshContainer();
}
@@ -392,17 +390,18 @@ void VersionPage::on_forgeBtn_clicked()
void VersionPage::on_liteloaderBtn_clicked()
{
- VersionSelectDialog vselect(MMC->liteloaderlist().get(), tr("Select LiteLoader version"),
- this);
+ auto vlist = ENV.getVersionList("com.liteloader");
+ if(!vlist)
+ {
+ return;
+ }
+ VersionSelectDialog vselect(vlist.get(), tr("Select LiteLoader version"), this);
vselect.setExactFilter(BaseVersionList::ParentGameVersionRole, m_inst->currentVersionId());
- vselect.setEmptyString(tr("No LiteLoader versions are currently available for Minecraft ") +
- m_inst->currentVersionId());
+ vselect.setEmptyString(tr("No LiteLoader versions are currently available for Minecraft ") + m_inst->currentVersionId());
vselect.setEmptyErrorString(tr("Couldn't load or download the LiteLoader version lists!"));
if (vselect.exec() && vselect.selectedVersion())
{
- ProgressDialog dialog(this);
- dialog.execWithTask(
- LiteLoaderInstaller().createInstallTask(m_inst, vselect.selectedVersion(), this));
+ m_profile->installVersion(vselect.selectedVersion());
preselect(m_profile->rowCount(QModelIndex())-1);
m_container->refreshContainer();
}