diff options
author | Petr Mrázek <peterix@gmail.com> | 2015-02-09 01:51:14 +0100 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2015-04-12 20:57:18 +0200 |
commit | db877ba121ff87a4e029daf8555d85dfef45993a (patch) | |
tree | 7673f83c404b3883f0a4fcf6b492f0c4125c293c /logic/tools/JProfiler.cpp | |
parent | 4730f54df7edf4775dfddf45f77c60edd86c32d9 (diff) | |
download | PrismLauncher-db877ba121ff87a4e029daf8555d85dfef45993a.tar.gz PrismLauncher-db877ba121ff87a4e029daf8555d85dfef45993a.tar.bz2 PrismLauncher-db877ba121ff87a4e029daf8555d85dfef45993a.zip |
NOISSUE move everything.
Diffstat (limited to 'logic/tools/JProfiler.cpp')
-rw-r--r-- | logic/tools/JProfiler.cpp | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/logic/tools/JProfiler.cpp b/logic/tools/JProfiler.cpp index 7cdf0268..d53ec615 100644 --- a/logic/tools/JProfiler.cpp +++ b/logic/tools/JProfiler.cpp @@ -3,22 +3,23 @@ #include <QDir> #include <QMessageBox> -#include "logic/settings/SettingsObject.h" -#include "logic/BaseProcess.h" -#include "logic/BaseInstance.h" -#include "MultiMC.h" +#include "settings/SettingsObject.h" +#include "BaseProcess.h" +#include "BaseInstance.h" -JProfiler::JProfiler(InstancePtr instance, QObject *parent) : BaseProfiler(instance, parent) +JProfiler::JProfiler(SettingsObjectPtr settings, InstancePtr instance, + QObject *parent) + : BaseProfiler(settings, instance, parent) { } void JProfiler::beginProfilingImpl(BaseProcess *process) { - int port = MMC->settings()->get("JProfilerPort").toInt(); + int port = globalSettings->get("JProfilerPort").toInt(); QProcess *profiler = new QProcess(this); profiler->setArguments(QStringList() << "-d" << QString::number(pid(process)) << "--gui" << "-p" << QString::number(port)); - profiler->setProgram(QDir(MMC->settings()->get("JProfilerPath").toString()) + profiler->setProgram(QDir(globalSettings->get("JProfilerPath").toString()) #ifdef Q_OS_WIN .absoluteFilePath("bin/jpenable.exe")); #else @@ -44,20 +45,21 @@ void JProfiler::beginProfilingImpl(BaseProcess *process) m_profilerProcess = profiler; } -void JProfilerFactory::registerSettings(std::shared_ptr<SettingsObject> settings) +void JProfilerFactory::registerSettings(SettingsObjectPtr settings) { settings->registerSetting("JProfilerPath"); settings->registerSetting("JProfilerPort", 42042); + globalSettings = settings; } BaseExternalTool *JProfilerFactory::createTool(InstancePtr instance, QObject *parent) { - return new JProfiler(instance, parent); + return new JProfiler(globalSettings, instance, parent); } bool JProfilerFactory::check(QString *error) { - return check(MMC->settings()->get("JProfilerPath").toString(), error); + return check(globalSettings->get("JProfilerPath").toString(), error); } bool JProfilerFactory::check(const QString &path, QString *error) |