PrismLauncher/logic/tools/BaseProfiler.cpp

36 lines
694 B
C++
Raw Normal View History

#include "BaseProfiler.h"
2014-02-15 17:15:41 +00:00
#include <QProcess>
2014-03-30 19:11:05 +01:00
BaseProfiler::BaseProfiler(InstancePtr instance, QObject *parent)
: BaseExternalTool(instance, parent)
{
}
2015-01-27 21:31:07 +00:00
void BaseProfiler::beginProfiling(BaseProcess *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"));
}
2014-03-30 19:11:05 +01:00
BaseProfiler *BaseProfilerFactory::createProfiler(InstancePtr instance, QObject *parent)
{
return qobject_cast<BaseProfiler *>(createTool(instance, parent));
}