aboutsummaryrefslogtreecommitdiff
path: root/launcher/tools/BaseProfiler.cpp
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2021-07-25 19:11:59 +0200
committerPetr Mrázek <peterix@gmail.com>2021-07-25 19:50:44 +0200
commit20b9f2b42a3b58b6081af271774fbcc34025dccb (patch)
tree064fa59facb3357139b47bd4e60bfc8edb35ca11 /launcher/tools/BaseProfiler.cpp
parentdd133680858351e3e07690e286882327a4f42ba5 (diff)
downloadPrismLauncher-20b9f2b42a3b58b6081af271774fbcc34025dccb.tar.gz
PrismLauncher-20b9f2b42a3b58b6081af271774fbcc34025dccb.tar.bz2
PrismLauncher-20b9f2b42a3b58b6081af271774fbcc34025dccb.zip
NOISSUE Flatten gui and logic libraries into MultiMC
Diffstat (limited to 'launcher/tools/BaseProfiler.cpp')
-rw-r--r--launcher/tools/BaseProfiler.cpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/launcher/tools/BaseProfiler.cpp b/launcher/tools/BaseProfiler.cpp
new file mode 100644
index 00000000..300d1a73
--- /dev/null
+++ b/launcher/tools/BaseProfiler.cpp
@@ -0,0 +1,36 @@
+#include "BaseProfiler.h"
+#include "QObjectPtr.h"
+
+#include <QProcess>
+
+BaseProfiler::BaseProfiler(SettingsObjectPtr settings, InstancePtr instance, QObject *parent)
+ : BaseExternalTool(settings, instance, parent)
+{
+}
+
+void BaseProfiler::beginProfiling(shared_qobject_ptr<LaunchTask> process)
+{
+ beginProfilingImpl(process);
+}
+
+void BaseProfiler::abortProfiling()
+{
+ abortProfilingImpl();
+}
+
+void BaseProfiler::abortProfilingImpl()
+{
+ if (!m_profilerProcess)
+ {
+ 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));
+}