summaryrefslogtreecommitdiffstats
path: root/MultiMC.cpp
diff options
context:
space:
mode:
authorJan Dalheimer <jan@dalheimer.de>2014-02-15 14:19:35 +0100
committerJan Dalheimer <jan@dalheimer.de>2014-02-15 14:19:35 +0100
commitefa8e26a3f3f7ba5e536cd10e86303b4fe1baba0 (patch)
tree4fcd3e9f210c92dbeac9f820f2ab1fd2d6dd9e58 /MultiMC.cpp
parent5cf599673db88b39100ffca78e10bbe5e10200d7 (diff)
downloadMultiMC-efa8e26a3f3f7ba5e536cd10e86303b4fe1baba0.tar
MultiMC-efa8e26a3f3f7ba5e536cd10e86303b4fe1baba0.tar.gz
MultiMC-efa8e26a3f3f7ba5e536cd10e86303b4fe1baba0.tar.lz
MultiMC-efa8e26a3f3f7ba5e536cd10e86303b4fe1baba0.tar.xz
MultiMC-efa8e26a3f3f7ba5e536cd10e86303b4fe1baba0.zip
Profiler support. Currently JProfiler and JVisualVM are implemented.
Diffstat (limited to 'MultiMC.cpp')
-rw-r--r--MultiMC.cpp25
1 files changed, 23 insertions, 2 deletions
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 <inisettingsobject.h>
@@ -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<BaseProfilerFactory>(new JProfilerFactory()));
+ m_profilers.insert("jvisualvm",
+ std::shared_ptr<BaseProfilerFactory>(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<JavaVersionList> MultiMC::javalist()
return m_javalist;
}
+std::shared_ptr<BaseProfilerFactory> 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