pollymc/logic/tools/BaseProfiler.cpp

36 lines
703 B
C++
Raw Normal View History

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