PrismLauncher/logic/tools/BaseProfiler.cpp

36 lines
703 B
C++
Raw Normal View History

#include "BaseProfiler.h"
2014-02-15 17:15:41 +00:00
#include <QProcess>
BaseProfiler::BaseProfiler(BaseInstance *instance, QObject *parent)
: BaseExternalTool(instance, parent)
{
}
void BaseProfiler::beginProfiling(MinecraftProcess *process)
{
beginProfilingImpl(process);
}
void BaseProfiler::abortProfiling()
{
2014-02-16 08:30:38 +00:00
abortProfilingImpl();
}
void BaseProfiler::abortProfilingImpl()
{
if (!m_profilerProcess)
{
return;
}
m_profilerProcess->terminate();
m_profilerProcess->deleteLater();
2014-02-16 08:30:38 +00:00
m_profilerProcess = 0;
emit abortLaunch(tr("Profiler aborted"));
}
BaseProfiler *BaseProfilerFactory::createProfiler(BaseInstance *instance, QObject *parent)
{
return qobject_cast<BaseProfiler *>(createTool(instance, parent));
}