PrismLauncher/launcher/tools/BaseProfiler.cpp

34 lines
803 B
C++
Raw Normal View History

#include "BaseProfiler.h"
#include "QObjectPtr.h"
2014-02-15 17:15:41 +00:00
#include <QProcess>
BaseProfiler::BaseProfiler(SettingsObjectPtr settings, InstancePtr instance, QObject* parent) : BaseExternalTool(settings, instance, parent)
{}
void BaseProfiler::beginProfiling(shared_qobject_ptr<LaunchTask> process)
{
2018-07-15 13:51:05 +01:00
beginProfilingImpl(process);
}
void BaseProfiler::abortProfiling()
{
2018-07-15 13:51:05 +01:00
abortProfilingImpl();
}
void BaseProfiler::abortProfilingImpl()
{
if (!m_profilerProcess) {
2018-07-15 13:51:05 +01:00
return;
}
m_profilerProcess->terminate();
m_profilerProcess->deleteLater();
m_profilerProcess = 0;
emit abortLaunch(tr("Profiler aborted"));
}
BaseProfiler* BaseProfilerFactory::createProfiler(InstancePtr instance, QObject* parent)
{
return qobject_cast<BaseProfiler*>(createTool(instance, parent));
}