diff options
author | Petr Mrázek <peterix@gmail.com> | 2014-02-24 00:29:13 +0100 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2014-02-24 00:29:13 +0100 |
commit | f7c97efcf3785f597417895945b24c2e7476cba8 (patch) | |
tree | c0ad8ba4b59bf9be441c2037ae7592585c3cbe58 /logic/tools/BaseProfiler.cpp | |
parent | e3d2e5fd7405baa8137e300e8cc817e70df172b7 (diff) | |
parent | a354e8bfae812b23b85b65c4a5b7e860cb18080c (diff) | |
download | PrismLauncher-f7c97efcf3785f597417895945b24c2e7476cba8.tar.gz PrismLauncher-f7c97efcf3785f597417895945b24c2e7476cba8.tar.bz2 PrismLauncher-f7c97efcf3785f597417895945b24c2e7476cba8.zip |
Merge branch 'feature_profiling' into integration_json_and_tools
Diffstat (limited to 'logic/tools/BaseProfiler.cpp')
-rw-r--r-- | logic/tools/BaseProfiler.cpp | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/logic/tools/BaseProfiler.cpp b/logic/tools/BaseProfiler.cpp new file mode 100644 index 00000000..9aaca793 --- /dev/null +++ b/logic/tools/BaseProfiler.cpp @@ -0,0 +1,35 @@ +#include "BaseProfiler.h" + +#include <QProcess> + +BaseProfiler::BaseProfiler(BaseInstance *instance, QObject *parent) + : BaseExternalTool(instance, parent) +{ +} + +void BaseProfiler::beginProfiling(MinecraftProcess *process) +{ + beginProfilingImpl(process); +} + +void BaseProfiler::abortProfiling() +{ + abortProfilingImpl(); +} + +void BaseProfiler::abortProfilingImpl() +{ + if (!m_profilerProcess) + { + return; + } + m_profilerProcess->terminate(); + m_profilerProcess->deleteLater(); + m_profilerProcess = 0; + emit abortLaunch(tr("Profiler aborted")); +} + +BaseProfiler *BaseProfilerFactory::createProfiler(BaseInstance *instance, QObject *parent) +{ + return qobject_cast<BaseProfiler *>(createTool(instance, parent)); +} |