diff options
author | Petr Mrázek <peterix@gmail.com> | 2015-01-31 16:59:03 +0100 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2015-04-02 11:30:24 +0200 |
commit | 6f3aa65bd69f5155fa1ee56dee840e2e7e1d3c6f (patch) | |
tree | 28aaf76918d1ff0ffe2a437573bb1ab7a012c4ec /gui/MainWindow.cpp | |
parent | e508728246043fcaf8bee565e73b15e15eb2e531 (diff) | |
download | MultiMC-6f3aa65bd69f5155fa1ee56dee840e2e7e1d3c6f.tar MultiMC-6f3aa65bd69f5155fa1ee56dee840e2e7e1d3c6f.tar.gz MultiMC-6f3aa65bd69f5155fa1ee56dee840e2e7e1d3c6f.tar.lz MultiMC-6f3aa65bd69f5155fa1ee56dee840e2e7e1d3c6f.tar.xz MultiMC-6f3aa65bd69f5155fa1ee56dee840e2e7e1d3c6f.zip |
NOISSUE Split MultiMC app object into MultiMC and Env
Diffstat (limited to 'gui/MainWindow.cpp')
-rw-r--r-- | gui/MainWindow.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/gui/MainWindow.cpp b/gui/MainWindow.cpp index f12ccf24..721a6833 100644 --- a/gui/MainWindow.cpp +++ b/gui/MainWindow.cpp @@ -375,6 +375,7 @@ namespace Ui { #include "logic/net/URLConstants.h" #include "logic/net/NetJob.h" +#include "logic/Env.h" #include "logic/BaseInstance.h" #include "logic/OneSixInstance.h" @@ -572,7 +573,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi { for (auto profile : account->profiles()) { - auto meta = MMC->metacache()->resolveEntry("skins", profile.name + ".png"); + auto meta = Env::getInstance().metacache()->resolveEntry("skins", profile.name + ".png"); auto action = CacheDownload::make( QUrl("http://" + URLConstants::SKINS_BASE + profile.name + ".png"), meta); skin_dls.append(action); @@ -619,7 +620,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi if (MMC->settings()->get("AutoUpdate").toBool()) { auto updater = MMC->updateChecker(); - updater->checkForUpdate(false); + updater->checkForUpdate(MMC->settings()->get("UpdateChannel").toString(), false); } m_notificationChecker.reset(new NotificationChecker()); connect(m_notificationChecker.get(), @@ -981,7 +982,7 @@ void MainWindow::downloadUpdates(QString repo, int versionId, bool installOnExit // Doing so is a bit complicated, because we'd have to make sure it finished downloading // before actually exiting MultiMC. ProgressDialog updateDlg(this); - DownloadUpdateTask updateTask(repo, versionId, &updateDlg); + DownloadUpdateTask updateTask(MMC->root(), repo, versionId, &updateDlg); // If the task succeeds, install the updates. if (updateDlg.exec(&updateTask)) { @@ -1070,7 +1071,7 @@ void MainWindow::instanceFromZipPack(QString instName, QString instGroup, QStrin else { const QString path = url.host() + '/' + url.path(); - auto entry = MMC->metacache()->resolveEntry("general", path); + auto entry = ENV.metacache()->resolveEntry("general", path); CacheDownloadPtr dl = CacheDownload::make(url, entry); NetJob job(tr("Modpack download")); job.addNetAction(dl); @@ -1357,7 +1358,7 @@ void MainWindow::on_actionConfig_Folder_triggered() void MainWindow::on_actionCheckUpdate_triggered() { auto updater = MMC->updateChecker(); - updater->checkForUpdate(true); + updater->checkForUpdate(MMC->settings()->get("UpdateChannel").toString(), true); } template <typename T> |