From 2980322c3b34b252ead838daee7a844853feccf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Sun, 12 Mar 2017 19:45:28 +0100 Subject: NOISSUE Remove Minecraft version list and versions. --- application/MainWindow.cpp | 17 ++--------------- application/MainWindow.h | 1 - application/MultiMC.cpp | 12 ------------ application/MultiMC.h | 3 --- application/dialogs/NewInstanceDialog.cpp | 11 +++++++---- application/pages/VersionPage.cpp | 8 ++++++-- 6 files changed, 15 insertions(+), 37 deletions(-) (limited to 'application') diff --git a/application/MainWindow.cpp b/application/MainWindow.cpp index 3bdf540d..9073c006 100644 --- a/application/MainWindow.cpp +++ b/application/MainWindow.cpp @@ -54,7 +54,6 @@ #include #include #include -#include #include #include #include @@ -558,6 +557,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new MainWindow // run the things that load and download other things... FIXME: this is NOT the place // FIXME: invisible actions in the background = NOPE. { + /* if (!MMC->minecraftlist()->isLoaded()) { m_versionLoadTask = MMC->minecraftlist()->getLoadTask(); @@ -567,6 +567,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new MainWindow { MMC->lwjgllist()->loadList(); } + */ m_newsChecker->reloadNews(); updateNewsLabel(); @@ -1014,18 +1015,6 @@ void MainWindow::setCatBackground(bool enabled) } } -// FIXME: eliminate, should not be needed -void MainWindow::waitForMinecraftVersions() -{ - if (!MMC->minecraftlist()->isLoaded() && m_versionLoadTask && m_versionLoadTask->isRunning()) - { - QEventLoop waitLoop; - waitLoop.connect(m_versionLoadTask, &Task::failed, &waitLoop, &QEventLoop::quit); - waitLoop.connect(m_versionLoadTask, &Task::succeeded, &waitLoop, &QEventLoop::quit); - waitLoop.exec(); - } -} - void MainWindow::runModalTask(Task *task) { connect(task, &Task::failed, [this](QString reason) @@ -1117,8 +1106,6 @@ void MainWindow::on_actionAddInstance_triggered() groupName = map["group"].toString(); } while(0); - waitForMinecraftVersions(); - if(groupName.isEmpty()) { groupName = MMC->settings()->get("LastUsedGroupForNewInstance").toString(); diff --git a/application/MainWindow.h b/application/MainWindow.h index 6b30c86e..a7ab9172 100644 --- a/application/MainWindow.h +++ b/application/MainWindow.h @@ -167,7 +167,6 @@ private: void updateInstanceToolIcon(QString new_icon); void setSelectedInstanceById(const QString &id); - void waitForMinecraftVersions(); void runModalTask(Task *task); void instanceFromVersion(QString instName, QString instGroup, QString instIcon, BaseVersionPtr version); void instanceFromZipPack(QString instName, QString instGroup, QString instIcon, QUrl url); diff --git a/application/MultiMC.cpp b/application/MultiMC.cpp index 3a91fb5f..98b73a6e 100644 --- a/application/MultiMC.cpp +++ b/application/MultiMC.cpp @@ -42,7 +42,6 @@ #include "icons/IconList.h" //FIXME: get rid of this #include "minecraft/legacy/LwjglVersionList.h" -#include "minecraft/MinecraftVersionList.h" #include "minecraft/liteloader/LiteLoaderVersionList.h" #include "minecraft/forge/ForgeVersionList.h" @@ -338,7 +337,6 @@ MultiMC::MultiMC(int &argc, char **argv) : QApplication(argc, argv) initIcons(); initThemes(); // make sure we have at least some minecraft versions before we init instances - minecraftlist(); initInstances(); initAccounts(); initNetwork(); @@ -890,16 +888,6 @@ std::shared_ptr MultiMC::liteloaderlist() return m_liteloaderlist; } -std::shared_ptr MultiMC::minecraftlist() -{ - if (!m_minecraftlist) - { - m_minecraftlist.reset(new MinecraftVersionList()); - ENV.registerVersionList("net.minecraft", m_minecraftlist); - } - return m_minecraftlist; -} - std::shared_ptr MultiMC::javalist() { if (!m_javalist) diff --git a/application/MultiMC.h b/application/MultiMC.h index d8062bb5..8dc2e609 100644 --- a/application/MultiMC.h +++ b/application/MultiMC.h @@ -18,7 +18,6 @@ class SetupWizard; class FolderInstanceProvider; class GenericPageProvider; class QFile; -class MinecraftVersionList; class LWJGLVersionList; class HttpMetaCache; class SettingsObject; @@ -96,7 +95,6 @@ public: } std::shared_ptr translations(); - std::shared_ptr minecraftlist(); std::shared_ptr lwjgllist(); std::shared_ptr forgelist(); std::shared_ptr liteloaderlist(); @@ -204,7 +202,6 @@ private: std::shared_ptr m_lwjgllist; std::shared_ptr m_forgelist; std::shared_ptr m_liteloaderlist; - std::shared_ptr m_minecraftlist; std::shared_ptr m_javalist; std::shared_ptr m_translations; std::shared_ptr m_globalSettingsProvider; diff --git a/application/dialogs/NewInstanceDialog.cpp b/application/dialogs/NewInstanceDialog.cpp index d53e1959..2e8e3ff7 100644 --- a/application/dialogs/NewInstanceDialog.cpp +++ b/application/dialogs/NewInstanceDialog.cpp @@ -19,7 +19,6 @@ #include #include -#include #include #include @@ -62,7 +61,12 @@ NewInstanceDialog::NewInstanceDialog(const QString & initialGroup, QWidget *pare resize(minimumSizeHint()); layout()->setSizeConstraint(QLayout::SetFixedSize); - setSelectedVersion(MMC->minecraftlist()->getRecommended()); + // FIXME: bring this back... + auto vlist = ENV.getVersionList("net.minecraft"); + if(vlist) + { + setSelectedVersion(vlist->getRecommended()); + } InstIconKey = "default"; ui->iconButton->setIcon(MMC->icons()->getIcon(InstIconKey)); @@ -192,8 +196,7 @@ BaseVersionPtr NewInstanceDialog::selectedVersion() const void NewInstanceDialog::on_btnChangeVersion_clicked() { - VersionSelectDialog vselect(MMC->minecraftlist().get(), tr("Change Minecraft version"), - this); + VersionSelectDialog vselect(ENV.getVersionList("net.minecraft").get(), tr("Change Minecraft version"), this); vselect.exec(); if (vselect.result() == QDialog::Accepted) { diff --git a/application/pages/VersionPage.cpp b/application/pages/VersionPage.cpp index 8decc649..b90b3e43 100644 --- a/application/pages/VersionPage.cpp +++ b/application/pages/VersionPage.cpp @@ -42,8 +42,6 @@ #include "minecraft/liteloader/LiteLoaderInstaller.h" #include "minecraft/auth/MojangAccountList.h" #include "minecraft/Mod.h" -#include "minecraft/MinecraftVersion.h" -#include "minecraft/MinecraftVersionList.h" #include "icons/IconList.h" #include "Exception.h" @@ -489,6 +487,8 @@ int VersionPage::currentRow() void VersionPage::on_customizeBtn_clicked() { + // TODO: implement + /* auto version = currentRow(); if(version == -1) { @@ -510,6 +510,7 @@ void VersionPage::on_customizeBtn_clicked() } updateButtons(); preselect(currentIdx); + */ } void VersionPage::on_editBtn_clicked() @@ -530,6 +531,8 @@ void VersionPage::on_editBtn_clicked() void VersionPage::on_revertBtn_clicked() { + // TODO: implement + /* auto version = currentRow(); if(version == -1) { @@ -551,6 +554,7 @@ void VersionPage::on_revertBtn_clicked() updateButtons(); preselect(currentIdx); m_container->refreshContainer(); + */ } #include "VersionPage.moc" -- cgit v1.2.3