2014-02-15 18:49:35 +05:30
|
|
|
#include "BaseProfiler.h"
|
|
|
|
|
2014-02-15 22:45:41 +05:30
|
|
|
#include <QProcess>
|
|
|
|
|
2014-02-16 02:56:44 +05:30
|
|
|
BaseProfiler::BaseProfiler(BaseInstance *instance, QObject *parent)
|
2014-02-16 15:16:14 +05:30
|
|
|
: BaseExternalTool(instance, parent)
|
2014-02-15 18:49:35 +05:30
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void BaseProfiler::beginProfiling(MinecraftProcess *process)
|
|
|
|
{
|
|
|
|
beginProfilingImpl(process);
|
|
|
|
}
|
|
|
|
|
2014-02-16 13:24:52 +05:30
|
|
|
void BaseProfiler::abortProfiling()
|
|
|
|
{
|
2014-02-16 14:00:38 +05:30
|
|
|
abortProfilingImpl();
|
2014-02-16 13:24:52 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
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"));
|
2014-02-16 13:24:52 +05:30
|
|
|
}
|
|
|
|
|
2014-02-16 15:16:14 +05:30
|
|
|
BaseProfiler *BaseProfilerFactory::createProfiler(BaseInstance *instance, QObject *parent)
|
2014-02-15 18:49:35 +05:30
|
|
|
{
|
2014-02-16 15:16:14 +05:30
|
|
|
return qobject_cast<BaseProfiler *>(createTool(instance, parent));
|
2014-02-15 18:49:35 +05:30
|
|
|
}
|