summaryrefslogtreecommitdiffstats
path: root/logic/tools
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2015-05-11 22:21:37 +0200
committerPetr Mrázek <peterix@gmail.com>2015-06-30 07:16:20 +0200
commit34ddfc7ecc2b0450b3d501e65cb4203ac747ed42 (patch)
treec53d32ac89aa996347901ea64f25909231a75895 /logic/tools
parentd14a61b0df38d150e1449b19b7eee411e91e5211 (diff)
downloadMultiMC-34ddfc7ecc2b0450b3d501e65cb4203ac747ed42.tar
MultiMC-34ddfc7ecc2b0450b3d501e65cb4203ac747ed42.tar.gz
MultiMC-34ddfc7ecc2b0450b3d501e65cb4203ac747ed42.tar.lz
MultiMC-34ddfc7ecc2b0450b3d501e65cb4203ac747ed42.tar.xz
MultiMC-34ddfc7ecc2b0450b3d501e65cb4203ac747ed42.zip
GH-1053 base process and launch refactor, part 1
Diffstat (limited to 'logic/tools')
-rw-r--r--logic/tools/BaseExternalTool.cpp10
-rw-r--r--logic/tools/BaseExternalTool.h1
-rw-r--r--logic/tools/BaseProfiler.cpp2
-rw-r--r--logic/tools/BaseProfiler.h6
-rw-r--r--logic/tools/JProfiler.cpp8
-rw-r--r--logic/tools/JVisualVM.cpp8
6 files changed, 12 insertions, 23 deletions
diff --git a/logic/tools/BaseExternalTool.cpp b/logic/tools/BaseExternalTool.cpp
index d2931db7..af7f9a3f 100644
--- a/logic/tools/BaseExternalTool.cpp
+++ b/logic/tools/BaseExternalTool.cpp
@@ -19,16 +19,6 @@ BaseExternalTool::~BaseExternalTool()
{
}
-qint64 BaseExternalTool::pid(QProcess *process)
-{
-#ifdef Q_OS_WIN
- struct _PROCESS_INFORMATION *procinfo = process->pid();
- return procinfo->dwProcessId;
-#else
- return process->pid();
-#endif
-}
-
BaseDetachedTool::BaseDetachedTool(SettingsObjectPtr settings, InstancePtr instance, QObject *parent)
: BaseExternalTool(settings, instance, parent)
{
diff --git a/logic/tools/BaseExternalTool.h b/logic/tools/BaseExternalTool.h
index 3c0b23ed..be23036d 100644
--- a/logic/tools/BaseExternalTool.h
+++ b/logic/tools/BaseExternalTool.h
@@ -17,7 +17,6 @@ public:
protected:
InstancePtr m_instance;
SettingsObjectPtr globalSettings;
- qint64 pid(QProcess *process);
};
class BaseDetachedTool : public BaseExternalTool
diff --git a/logic/tools/BaseProfiler.cpp b/logic/tools/BaseProfiler.cpp
index 2c9fed9b..cfac47d4 100644
--- a/logic/tools/BaseProfiler.cpp
+++ b/logic/tools/BaseProfiler.cpp
@@ -7,7 +7,7 @@ BaseProfiler::BaseProfiler(SettingsObjectPtr settings, InstancePtr instance, QOb
{
}
-void BaseProfiler::beginProfiling(BaseProcess *process)
+void BaseProfiler::beginProfiling(BaseLauncher *process)
{
beginProfilingImpl(process);
}
diff --git a/logic/tools/BaseProfiler.h b/logic/tools/BaseProfiler.h
index 56397489..54ba89ce 100644
--- a/logic/tools/BaseProfiler.h
+++ b/logic/tools/BaseProfiler.h
@@ -4,7 +4,7 @@
class BaseInstance;
class SettingsObject;
-class BaseProcess;
+class BaseLauncher;
class QProcess;
class BaseProfiler : public BaseExternalTool
@@ -15,13 +15,13 @@ public:
public
slots:
- void beginProfiling(BaseProcess *process);
+ void beginProfiling(BaseLauncher *process);
void abortProfiling();
protected:
QProcess *m_profilerProcess;
- virtual void beginProfilingImpl(BaseProcess *process) = 0;
+ virtual void beginProfilingImpl(BaseLauncher *process) = 0;
virtual void abortProfilingImpl();
signals:
diff --git a/logic/tools/JProfiler.cpp b/logic/tools/JProfiler.cpp
index 2522f2b3..73121239 100644
--- a/logic/tools/JProfiler.cpp
+++ b/logic/tools/JProfiler.cpp
@@ -4,7 +4,7 @@
#include <QMessageBox>
#include "settings/SettingsObject.h"
-#include "BaseProcess.h"
+#include "BaseLauncher.h"
#include "BaseInstance.h"
class JProfiler : public BaseProfiler
@@ -18,7 +18,7 @@ private slots:
void profilerFinished(int exit, QProcess::ExitStatus status);
protected:
- void beginProfilingImpl(BaseProcess *process);
+ void beginProfilingImpl(BaseLauncher *process);
private:
int listeningPort = 0;
@@ -48,13 +48,13 @@ void JProfiler::profilerFinished(int exit, QProcess::ExitStatus status)
}
}
-void JProfiler::beginProfilingImpl(BaseProcess *process)
+void JProfiler::beginProfilingImpl(BaseLauncher *process)
{
listeningPort = globalSettings->get("JProfilerPort").toInt();
QProcess *profiler = new QProcess(this);
QStringList profilerArgs =
{
- "-d", QString::number(pid(process)),
+ "-d", QString::number(process->pid()),
"--gui",
"-p", QString::number(listeningPort)
};
diff --git a/logic/tools/JVisualVM.cpp b/logic/tools/JVisualVM.cpp
index e148e7dc..fbfd858a 100644
--- a/logic/tools/JVisualVM.cpp
+++ b/logic/tools/JVisualVM.cpp
@@ -4,7 +4,7 @@
#include <QStandardPaths>
#include "settings/SettingsObject.h"
-#include "BaseProcess.h"
+#include "BaseLauncher.h"
#include "BaseInstance.h"
class JVisualVM : public BaseProfiler
@@ -18,7 +18,7 @@ private slots:
void profilerFinished(int exit, QProcess::ExitStatus status);
protected:
- void beginProfilingImpl(BaseProcess *process);
+ void beginProfilingImpl(BaseLauncher *process);
};
@@ -45,12 +45,12 @@ void JVisualVM::profilerFinished(int exit, QProcess::ExitStatus status)
}
}
-void JVisualVM::beginProfilingImpl(BaseProcess *process)
+void JVisualVM::beginProfilingImpl(BaseLauncher *process)
{
QProcess *profiler = new QProcess(this);
QStringList profilerArgs =
{
- "--openpid", QString::number(pid(process))
+ "--openpid", QString::number(process->pid())
};
auto programPath = globalSettings->get("JVisualVMPath").toString();