From 3b236483dfe00f87c5f3b03220d78620f0f99f4d Mon Sep 17 00:00:00 2001 From: Jan Dalheimer Date: Sat, 15 Feb 2014 19:07:01 +0100 Subject: Another attempt at fixing windows build --- logic/profiler/BaseProfiler.cpp | 10 +++++++--- logic/profiler/JVisualVM.cpp | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/logic/profiler/BaseProfiler.cpp b/logic/profiler/BaseProfiler.cpp index 7934f6b4..94891fc4 100644 --- a/logic/profiler/BaseProfiler.cpp +++ b/logic/profiler/BaseProfiler.cpp @@ -1,6 +1,9 @@ #include "BaseProfiler.h" #include +#ifdef Q_OS_WIN +#include +#endif BaseProfiler::BaseProfiler(OneSixInstance *instance, QObject *parent) : QObject(parent), m_instance(instance) @@ -18,10 +21,11 @@ void BaseProfiler::beginProfiling(MinecraftProcess *process) qint64 BaseProfiler::pid(QProcess *process) { -#ifdef Q_OS_UNIX - return process->pid(); +#ifdef Q_OS_WIN + struct _PROCESS_INFORMATION *procinfo = process->pid(); + return procinfo->dwProcessId; #else - return (qint64)process->pid(); + return process->pid(); #endif } diff --git a/logic/profiler/JVisualVM.cpp b/logic/profiler/JVisualVM.cpp index ef46890a..a1aa6951 100644 --- a/logic/profiler/JVisualVM.cpp +++ b/logic/profiler/JVisualVM.cpp @@ -14,7 +14,7 @@ JVisualVM::JVisualVM(OneSixInstance *instance, QObject *parent) : BaseProfiler(i void JVisualVM::beginProfilingImpl(MinecraftProcess *process) { QProcess *profiler = new QProcess(this); - profiler->setArguments(QStringList() << "--openpid" << QString::number(process->pid())); + profiler->setArguments(QStringList() << "--openpid" << QString::number(pid(process))); profiler->setProgram("jvisualvm"); connect(profiler, &QProcess::started, [this]() { emit readyToLaunch(tr("JVisualVM started")); }); -- cgit v1.2.3