From 20b9f2b42a3b58b6081af271774fbcc34025dccb Mon Sep 17 00:00:00 2001 From: Petr Mrázek Date: Sun, 25 Jul 2021 19:11:59 +0200 Subject: NOISSUE Flatten gui and logic libraries into MultiMC --- launcher/tools/BaseProfiler.cpp | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 launcher/tools/BaseProfiler.cpp (limited to 'launcher/tools/BaseProfiler.cpp') diff --git a/launcher/tools/BaseProfiler.cpp b/launcher/tools/BaseProfiler.cpp new file mode 100644 index 00000000..300d1a73 --- /dev/null +++ b/launcher/tools/BaseProfiler.cpp @@ -0,0 +1,36 @@ +#include "BaseProfiler.h" +#include "QObjectPtr.h" + +#include + +BaseProfiler::BaseProfiler(SettingsObjectPtr settings, InstancePtr instance, QObject *parent) + : BaseExternalTool(settings, instance, parent) +{ +} + +void BaseProfiler::beginProfiling(shared_qobject_ptr 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(InstancePtr instance, QObject *parent) +{ + return qobject_cast(createTool(instance, parent)); +} -- cgit