pollymc/api/logic/tools/BaseProfiler.cpp

37 lines
813 B
C++
Raw Normal View History

#include "BaseProfiler.h"
#include "QObjectPtr.h"
2014-02-15 22:45:41 +05:30
#include <QProcess>
2015-02-09 06:21:14 +05:30
BaseProfiler::BaseProfiler(SettingsObjectPtr settings, InstancePtr instance, QObject *parent)
2018-07-15 18:21:05 +05:30
: BaseExternalTool(settings, instance, parent)
{
}
void BaseProfiler::beginProfiling(shared_qobject_ptr<LaunchTask> process)
{
2018-07-15 18:21:05 +05:30
beginProfilingImpl(process);
}
void BaseProfiler::abortProfiling()
{
2018-07-15 18:21:05 +05:30
abortProfilingImpl();
}
void BaseProfiler::abortProfilingImpl()
{
2018-07-15 18:21:05 +05:30
if (!m_profilerProcess)
{
return;
}
m_profilerProcess->terminate();
m_profilerProcess->deleteLater();
m_profilerProcess = 0;
emit abortLaunch(tr("Profiler aborted"));
}
2014-03-30 23:41:05 +05:30
BaseProfiler *BaseProfilerFactory::createProfiler(InstancePtr instance, QObject *parent)
{
2018-07-15 18:21:05 +05:30
return qobject_cast<BaseProfiler *>(createTool(instance, parent));
}