diff options
author | Petr Mrázek <peterix@gmail.com> | 2015-02-01 11:44:47 +0100 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2015-04-12 20:57:16 +0200 |
commit | aa70ed2244700dbcc93c1fadb22edc1c1caede37 (patch) | |
tree | 79fc6703e984edc4d631be8c6f40c71400f88aba /MultiMC.cpp | |
parent | 154d19bb74f4c5fc1519aa40cd9dfd20244273a1 (diff) | |
download | MultiMC-aa70ed2244700dbcc93c1fadb22edc1c1caede37.tar MultiMC-aa70ed2244700dbcc93c1fadb22edc1c1caede37.tar.gz MultiMC-aa70ed2244700dbcc93c1fadb22edc1c1caede37.tar.lz MultiMC-aa70ed2244700dbcc93c1fadb22edc1c1caede37.tar.xz MultiMC-aa70ed2244700dbcc93c1fadb22edc1c1caede37.zip |
SCRATCH move icons over to Env, instance proxy model to gui
Diffstat (limited to 'MultiMC.cpp')
-rw-r--r-- | MultiMC.cpp | 29 |
1 files changed, 14 insertions, 15 deletions
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<IconList> 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<LWJGLVersionList> MultiMC::lwjgllist() { if (!m_lwjgllist) |