1 #include "BaseProfiler.h"
2 #include "QObjectPtr.h"
3 
4 #include <QProcess>
5 
BaseProfiler(SettingsObjectPtr settings,InstancePtr instance,QObject * parent)6 BaseProfiler::BaseProfiler(SettingsObjectPtr settings, InstancePtr instance, QObject *parent)
7     : BaseExternalTool(settings, instance, parent)
8 {
9 }
10 
beginProfiling(shared_qobject_ptr<LaunchTask> process)11 void BaseProfiler::beginProfiling(shared_qobject_ptr<LaunchTask> process)
12 {
13     beginProfilingImpl(process);
14 }
15 
abortProfiling()16 void BaseProfiler::abortProfiling()
17 {
18     abortProfilingImpl();
19 }
20 
abortProfilingImpl()21 void BaseProfiler::abortProfilingImpl()
22 {
23     if (!m_profilerProcess)
24     {
25         return;
26     }
27     m_profilerProcess->terminate();
28     m_profilerProcess->deleteLater();
29     m_profilerProcess = 0;
30     emit abortLaunch(tr("Profiler aborted"));
31 }
32 
createProfiler(InstancePtr instance,QObject * parent)33 BaseProfiler *BaseProfilerFactory::createProfiler(InstancePtr instance, QObject *parent)
34 {
35     return qobject_cast<BaseProfiler *>(createTool(instance, parent));
36 }
37