From efa8e26a3f3f7ba5e536cd10e86303b4fe1baba0 Mon Sep 17 00:00:00 2001 From: Jan Dalheimer Date: Sat, 15 Feb 2014 14:19:35 +0100 Subject: Profiler support. Currently JProfiler and JVisualVM are implemented. --- MultiMC.cpp | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) (limited to 'MultiMC.cpp') diff --git a/MultiMC.cpp b/MultiMC.cpp index 598a3a80..b17afdc6 100644 --- a/MultiMC.cpp +++ b/MultiMC.cpp @@ -31,6 +31,9 @@ #include "logic/updater/UpdateChecker.h" #include "logic/updater/NotificationChecker.h" +#include "logic/profiler/JProfiler.h" +#include "logic/profiler/JVisualVM.h" + #include "pathutils.h" #include "cmdutils.h" #include @@ -41,8 +44,9 @@ using namespace Util::Commandline; MultiMC::MultiMC(int &argc, char **argv, bool root_override) - : QApplication(argc, argv), m_version{VERSION_MAJOR, VERSION_MINOR, VERSION_HOTFIX, - VERSION_BUILD, MultiMCVersion::VERSION_TYPE, VERSION_CHANNEL, BUILD_PLATFORM} + : QApplication(argc, argv), + m_version{VERSION_MAJOR, VERSION_MINOR, VERSION_HOTFIX, VERSION_BUILD, + MultiMCVersion::VERSION_TYPE, VERSION_CHANNEL, BUILD_PLATFORM} { setOrganizationName("MultiMC"); setApplicationName("MultiMC5"); @@ -211,6 +215,15 @@ MultiMC::MultiMC(int &argc, char **argv, bool root_override) // init proxy settings updateProxySettings(); + m_profilers.insert("jprofiler", + std::shared_ptr(new JProfilerFactory())); + m_profilers.insert("jvisualvm", + std::shared_ptr(new JVisualVMFactory())); + for (auto profiler : m_profilers.values()) + { + profiler->registerSettings(m_settings.get()); + } + // launch instance, if that's what should be done // WARNING: disabled until further notice /* @@ -426,6 +439,9 @@ void MultiMC::initGlobalSettings() m_settings->registerSetting("ConsoleWindowGeometry", ""); m_settings->registerSetting("SettingsGeometry", ""); + + // Profilers + m_settings->registerSetting("CurrentProfiler"); } void MultiMC::initHttpMetaCache() @@ -554,6 +570,11 @@ std::shared_ptr MultiMC::javalist() return m_javalist; } +std::shared_ptr MultiMC::currentProfiler() +{ + return m_profilers.value(m_settings->get("CurrentProfiler").toString()); +} + void MultiMC::installUpdates(const QString updateFilesDir, UpdateFlags flags) { // if we are going to update on exit, save the params now -- cgit v1.2.3 From 8219dbf612f4e6f603d304348fc388e364602f98 Mon Sep 17 00:00:00 2001 From: Jan Dalheimer Date: Sat, 15 Feb 2014 22:26:44 +0100 Subject: Underp. Don't depend on OneSix. Nicer "menu" style choosing. --- MultiMC.cpp | 8 -------- 1 file changed, 8 deletions(-) (limited to 'MultiMC.cpp') diff --git a/MultiMC.cpp b/MultiMC.cpp index b17afdc6..e3f60049 100644 --- a/MultiMC.cpp +++ b/MultiMC.cpp @@ -439,9 +439,6 @@ void MultiMC::initGlobalSettings() m_settings->registerSetting("ConsoleWindowGeometry", ""); m_settings->registerSetting("SettingsGeometry", ""); - - // Profilers - m_settings->registerSetting("CurrentProfiler"); } void MultiMC::initHttpMetaCache() @@ -570,11 +567,6 @@ std::shared_ptr MultiMC::javalist() return m_javalist; } -std::shared_ptr MultiMC::currentProfiler() -{ - return m_profilers.value(m_settings->get("CurrentProfiler").toString()); -} - void MultiMC::installUpdates(const QString updateFilesDir, UpdateFlags flags) { // if we are going to update on exit, save the params now -- cgit v1.2.3 From 616c37269053bc4f111792dbb9374cc119a58339 Mon Sep 17 00:00:00 2001 From: Jan Dalheimer Date: Sun, 16 Feb 2014 10:46:14 +0100 Subject: Fix more stuff. Detached tools, only MCEdit for now. --- MultiMC.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'MultiMC.cpp') diff --git a/MultiMC.cpp b/MultiMC.cpp index e3f60049..c813c425 100644 --- a/MultiMC.cpp +++ b/MultiMC.cpp @@ -33,6 +33,7 @@ #include "logic/profiler/JProfiler.h" #include "logic/profiler/JVisualVM.h" +#include "logic/MCEditTool.h" #include "pathutils.h" #include "cmdutils.h" @@ -223,6 +224,12 @@ MultiMC::MultiMC(int &argc, char **argv, bool root_override) { profiler->registerSettings(m_settings.get()); } + m_tools.insert("mcedit", + std::shared_ptr(new MCEditFactory())); + for (auto tool : m_tools.values()) + { + tool->registerSettings(m_settings.get()); + } // launch instance, if that's what should be done // WARNING: disabled until further notice -- cgit v1.2.3 From 9c87bc6c4b99f0c93f2b18039208dcf9f3fb4d79 Mon Sep 17 00:00:00 2001 From: Jan Dalheimer Date: Sun, 16 Feb 2014 12:52:35 +0100 Subject: Restructure --- MultiMC.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'MultiMC.cpp') diff --git a/MultiMC.cpp b/MultiMC.cpp index c813c425..294a4926 100644 --- a/MultiMC.cpp +++ b/MultiMC.cpp @@ -31,9 +31,9 @@ #include "logic/updater/UpdateChecker.h" #include "logic/updater/NotificationChecker.h" -#include "logic/profiler/JProfiler.h" -#include "logic/profiler/JVisualVM.h" -#include "logic/MCEditTool.h" +#include "logic/tools/JProfiler.h" +#include "logic/tools/JVisualVM.h" +#include "logic/tools/MCEditTool.h" #include "pathutils.h" #include "cmdutils.h" -- cgit v1.2.3