2014-02-15 14:19:35 +01:00
|
|
|
#include "BaseProfiler.h"
|
|
|
|
|
2014-02-15 18:15:41 +01:00
|
|
|
#include <QProcess>
|
|
|
|
|
2015-02-09 01:51:14 +01:00
|
|
|
BaseProfiler::BaseProfiler(SettingsObjectPtr settings, InstancePtr instance, QObject *parent)
|
|
|
|
: BaseExternalTool(settings, instance, parent)
|
2014-02-15 14:19:35 +01:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2015-01-27 22:31:07 +01:00
|
|
|
void BaseProfiler::beginProfiling(BaseProcess *process)
|
2014-02-15 14:19:35 +01:00
|
|
|
{
|
|
|
|
beginProfilingImpl(process);
|
|
|
|
}
|
|
|
|
|
2014-02-16 08:54:52 +01:00
|
|
|
void BaseProfiler::abortProfiling()
|
|
|
|
{
|
2014-02-16 09:30:38 +01:00
|
|
|
abortProfilingImpl();
|
2014-02-16 08:54:52 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void BaseProfiler::abortProfilingImpl()
|
|
|
|
{
|
|
|
|
if (!m_profilerProcess)
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
m_profilerProcess->terminate();
|
|
|
|
m_profilerProcess->deleteLater();
|
2014-02-16 09:30:38 +01:00
|
|
|
m_profilerProcess = 0;
|
|
|
|
emit abortLaunch(tr("Profiler aborted"));
|
2014-02-16 08:54:52 +01:00
|
|
|
}
|
|
|
|
|
2014-03-30 20:11:05 +02:00
|
|
|
BaseProfiler *BaseProfilerFactory::createProfiler(InstancePtr instance, QObject *parent)
|
2014-02-15 14:19:35 +01:00
|
|
|
{
|
2014-02-16 10:46:14 +01:00
|
|
|
return qobject_cast<BaseProfiler *>(createTool(instance, parent));
|
2014-02-15 14:19:35 +01:00
|
|
|
}
|