From aa70ed2244700dbcc93c1fadb22edc1c1caede37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Sun, 1 Feb 2015 11:44:47 +0100 Subject: SCRATCH move icons over to Env, instance proxy model to gui --- MultiMC.cpp | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) (limited to 'MultiMC.cpp') diff --git a/MultiMC.cpp b/MultiMC.cpp index 0b34d606..80a4593c 100644 --- a/MultiMC.cpp +++ b/MultiMC.cpp @@ -194,6 +194,9 @@ MultiMC::MultiMC(int &argc, char **argv, bool test_mode) : QApplication(argc, ar m_translationChecker.reset(new TranslationDownloader()); + // load icons + initIcons(); + // and instances auto InstDirSetting = m_settings->getSetting("InstanceDir"); // instance path: check for problems with '!' in instance path and warn the user in the log @@ -307,6 +310,17 @@ void MultiMC::initTranslations() } } +void MultiMC::initIcons() +{ + auto setting = MMC->settings()->getSetting("IconsDir"); + ENV.m_icons.reset(new IconList(QString(":/icons/instances/"), setting->get().toString())); + connect(setting.get(), &Setting::SettingChanged,[&](const Setting &, QVariant value) + { + ENV.m_icons->directoryChanged(value.toString()); + }); +} + + void moveFile(const QString &oldName, const QString &newName) { QFile::remove(newName); @@ -448,21 +462,6 @@ void MultiMC::initGlobalSettings(bool test_mode) m_settings->registerSetting("PagedGeometry", ""); } -std::shared_ptr MultiMC::icons() -{ - if (!m_icons) - { - - auto setting = MMC->settings()->getSetting("IconsDir"); - m_icons.reset(new IconList(setting->get().toString())); - connect(setting.get(), &Setting::SettingChanged,[&](const Setting &, QVariant value) - { - m_icons->directoryChanged(value.toString()); - }); - } - return m_icons; -} - std::shared_ptr MultiMC::lwjgllist() { if (!m_lwjgllist) -- cgit v1.2.3