2014-02-15 13:19:35 +00:00
|
|
|
#include "BaseProfiler.h"
|
|
|
|
|
2014-02-15 17:15:41 +00:00
|
|
|
#include <QProcess>
|
|
|
|
|
2014-02-15 21:26:44 +00:00
|
|
|
BaseProfiler::BaseProfiler(BaseInstance *instance, QObject *parent)
|
2014-02-16 09:46:14 +00:00
|
|
|
: BaseExternalTool(instance, parent)
|
2014-02-15 13:19:35 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void BaseProfiler::beginProfiling(MinecraftProcess *process)
|
|
|
|
{
|
|
|
|
beginProfilingImpl(process);
|
|
|
|
}
|
|
|
|
|
2014-02-16 07:54:52 +00:00
|
|
|
void BaseProfiler::abortProfiling()
|
|
|
|
{
|
2014-02-16 08:30:38 +00:00
|
|
|
abortProfilingImpl();
|
2014-02-16 07:54:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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"));
|
2014-02-16 07:54:52 +00:00
|
|
|
}
|
|
|
|
|
2014-02-16 09:46:14 +00:00
|
|
|
BaseProfiler *BaseProfilerFactory::createProfiler(BaseInstance *instance, QObject *parent)
|
2014-02-15 13:19:35 +00:00
|
|
|
{
|
2014-02-16 09:46:14 +00:00
|
|
|
return qobject_cast<BaseProfiler *>(createTool(instance, parent));
|
2014-02-15 13:19:35 +00:00
|
|
|
}
|