diff options
Diffstat (limited to 'MultiMC.cpp')
-rw-r--r-- | MultiMC.cpp | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/MultiMC.cpp b/MultiMC.cpp index 3d62f76e..e425aa44 100644 --- a/MultiMC.cpp +++ b/MultiMC.cpp @@ -32,8 +32,8 @@ using namespace Util::Commandline; MultiMC::MultiMC(int &argc, char **argv) : QApplication(argc, argv) { - setOrganizationName("MultiMC"); - setApplicationName("MultiMC5"); + setOrganizationName("MultiMC"); + setApplicationName("MultiMC5"); initTranslations(); @@ -139,13 +139,19 @@ MultiMC::MultiMC(int &argc, char **argv) : QApplication(argc, argv) initGlobalSettings(); // and instances - m_instances.reset(new InstanceList(m_settings->get("InstanceDir").toString(), this)); + auto InstDirSetting = m_settings->getSetting("InstanceDir"); + m_instances.reset(new InstanceList(InstDirSetting->get().toString(), this)); QLOG_INFO() << "Loading Instances..."; m_instances->loadList(); + connect(InstDirSetting, SIGNAL(settingChanged(const Setting &, QVariant)), + m_instances.get(), SLOT(on_InstFolderChanged(const Setting &, QVariant))); // init the http meta cache initHttpMetaCache(); + // set up a basic autodetected proxy (system default) + QNetworkProxyFactory::setUseSystemConfiguration(true); + // create the global network manager m_qnam.reset(new QNetworkAccessManager(this)); @@ -348,20 +354,24 @@ std::shared_ptr<JavaVersionList> MultiMC::javalist() return m_javalist; } -int main(int argc, char *argv[]) +int main_gui(MultiMC & app) { - // initialize Qt - MultiMC app(argc, argv); - // show main window MainWindow mainWin; mainWin.show(); mainWin.checkSetDefaultJava(); + return app.exec(); +} + +int main(int argc, char *argv[]) +{ + // initialize Qt + MultiMC app(argc, argv); switch (app.status()) { case MultiMC::Initialized: - return app.exec(); + return main_gui(app); case MultiMC::Failed: return 1; case MultiMC::Succeeded: |