summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhjk <hjk@qt.io>2017-03-09 16:18:58 +0100
committerhjk <hjk@qt.io>2017-03-10 16:44:13 +0000
commitfa67aa084bb53894273a8d531fae0344771a61a7 (patch)
treedaa37d1ed1d275ea7eb2b0e29df17882f5c428b2
parentc63805668fa92db4062b5d5f92c033151c3699e3 (diff)
downloadqt-creator-fa67aa084bb53894273a8d531fae0344771a61a7.tar.gz
ProjectExplorer: Return a ProcessHandle for AppLauncher::applicationPID
Change-Id: I00fc4dbd3a3c022006de95087b61a86bbb83faeb Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
-rw-r--r--src/plugins/nim/project/nimruncontrol.cpp4
-rw-r--r--src/plugins/projectexplorer/applicationlauncher.cpp4
-rw-r--r--src/plugins/projectexplorer/applicationlauncher.h3
-rw-r--r--src/plugins/projectexplorer/localapplicationruncontrol.cpp4
-rw-r--r--src/plugins/pythoneditor/pythoneditorplugin.cpp4
-rw-r--r--src/plugins/valgrind/valgrindprocess.cpp2
6 files changed, 11 insertions, 10 deletions
diff --git a/src/plugins/nim/project/nimruncontrol.cpp b/src/plugins/nim/project/nimruncontrol.cpp
index 64a98ce99f..3e5ea4eee5 100644
--- a/src/plugins/nim/project/nimruncontrol.cpp
+++ b/src/plugins/nim/project/nimruncontrol.cpp
@@ -53,7 +53,7 @@ void NimRunControl::start()
{
reportApplicationStart();
m_applicationLauncher.start(m_runnable);
- setApplicationProcessHandle(ProcessHandle(m_applicationLauncher.applicationPID()));
+ setApplicationProcessHandle(m_applicationLauncher.applicationPID());
bringApplicationToForeground();
}
@@ -66,7 +66,7 @@ ProjectExplorer::RunControl::StopResult NimRunControl::stop()
void NimRunControl::processStarted()
{
// Console processes only know their pid after being started
- setApplicationProcessHandle(ProcessHandle(m_applicationLauncher.applicationPID()));
+ setApplicationProcessHandle(m_applicationLauncher.applicationPID());
}
void NimRunControl::processExited(int exitCode, QProcess::ExitStatus status)
diff --git a/src/plugins/projectexplorer/applicationlauncher.cpp b/src/plugins/projectexplorer/applicationlauncher.cpp
index 6fba44dbd7..64835b8a78 100644
--- a/src/plugins/projectexplorer/applicationlauncher.cpp
+++ b/src/plugins/projectexplorer/applicationlauncher.cpp
@@ -225,9 +225,9 @@ bool ApplicationLauncherPrivate::isRunning() const
return m_consoleProcess.isRunning();
}
-qint64 ApplicationLauncher::applicationPID() const
+ProcessHandle ApplicationLauncher::applicationPID() const
{
- return d->applicationPID();
+ return ProcessHandle(d->applicationPID());
}
qint64 ApplicationLauncherPrivate::applicationPID() const
diff --git a/src/plugins/projectexplorer/applicationlauncher.h b/src/plugins/projectexplorer/applicationlauncher.h
index 354281772f..9e4ce57ebb 100644
--- a/src/plugins/projectexplorer/applicationlauncher.h
+++ b/src/plugins/projectexplorer/applicationlauncher.h
@@ -30,6 +30,7 @@
#include "devicesupport/idevice.h"
#include <utils/outputformat.h>
+#include <utils/processhandle.h>
#include <QProcess>
@@ -59,7 +60,7 @@ public:
void start(const Runnable &runnable, const IDevice::ConstPtr &device);
void stop();
bool isRunning() const;
- qint64 applicationPID() const;
+ Utils::ProcessHandle applicationPID() const;
QString errorString() const;
QProcess::ProcessError processError() const;
diff --git a/src/plugins/projectexplorer/localapplicationruncontrol.cpp b/src/plugins/projectexplorer/localapplicationruncontrol.cpp
index f32e6c251e..9cd27dc166 100644
--- a/src/plugins/projectexplorer/localapplicationruncontrol.cpp
+++ b/src/plugins/projectexplorer/localapplicationruncontrol.cpp
@@ -88,7 +88,7 @@ void LocalApplicationRunControl::start()
QString msg = tr("Starting %1...").arg(QDir::toNativeSeparators(r.executable)) + QLatin1Char('\n');
appendMessage(msg, Utils::NormalMessageFormat);
m_applicationLauncher.start(r);
- setApplicationProcessHandle(ProcessHandle(m_applicationLauncher.applicationPID()));
+ setApplicationProcessHandle(m_applicationLauncher.applicationPID());
}
}
@@ -101,7 +101,7 @@ LocalApplicationRunControl::StopResult LocalApplicationRunControl::stop()
void LocalApplicationRunControl::processStarted()
{
// Console processes only know their pid after being started
- setApplicationProcessHandle(ProcessHandle(m_applicationLauncher.applicationPID()));
+ setApplicationProcessHandle(m_applicationLauncher.applicationPID());
bringApplicationToForeground();
}
diff --git a/src/plugins/pythoneditor/pythoneditorplugin.cpp b/src/plugins/pythoneditor/pythoneditorplugin.cpp
index a40978742c..da63b5232a 100644
--- a/src/plugins/pythoneditor/pythoneditorplugin.cpp
+++ b/src/plugins/pythoneditor/pythoneditorplugin.cpp
@@ -786,7 +786,7 @@ void PythonRunControl::start()
r.environment = m_environment;
m_applicationLauncher.start(r);
- setApplicationProcessHandle(ProcessHandle(m_applicationLauncher.applicationPID()));
+ setApplicationProcessHandle(m_applicationLauncher.applicationPID());
}
}
@@ -804,7 +804,7 @@ void PythonRunControl::slotAppendMessage(const QString &err, Utils::OutputFormat
void PythonRunControl::processStarted()
{
// Console processes only know their pid after being started
- setApplicationProcessHandle(ProcessHandle(m_applicationLauncher.applicationPID()));
+ setApplicationProcessHandle(m_applicationLauncher.applicationPID());
bringApplicationToForeground();
}
diff --git a/src/plugins/valgrind/valgrindprocess.cpp b/src/plugins/valgrind/valgrindprocess.cpp
index c9e27dfcca..5f45c90bb1 100644
--- a/src/plugins/valgrind/valgrindprocess.cpp
+++ b/src/plugins/valgrind/valgrindprocess.cpp
@@ -242,7 +242,7 @@ bool ValgrindProcess::isLocal() const
void ValgrindProcess::localProcessStarted()
{
- m_pid = m_localProcess.applicationPID();
+ m_pid = m_localProcess.applicationPID().pid();
emit started();
}