Remove ApplicationLauncher::Mode

The actual remaining use was to pop up a terminal in some
setups where Mode == Console, with a default of Gui meaning
"no console". In some downstream uses it was used set to
Console (probably to mean "this helper process does not need
a gui") but then luckily ignored when actually starting the
helper processes.

All cases where the console is useful and requested are
nowadays RunWorkers belonging to RunConfigurations with
a TerminalAspect, so they can directly get the relevant bit
from their RunConfiguration without having it part of
all StandardRunnables.

Change-Id: I1368d5968da5cf672656aebf200ccac8d45335d0
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2018-05-03 18:15:49 +02:00
parent d384e2398a
commit 0fbb2839f9
20 changed files with 52 additions and 62 deletions

View File

@@ -128,7 +128,6 @@ void CallgrindController::run(Option option)
Runnable controller = m_valgrindRunnable;
controller.executable = CALLGRIND_CONTROL_BINARY;
controller.runMode = ApplicationLauncher::Gui;
controller.commandLineArguments = QString("%1 %2").arg(toOptionString(option)).arg(m_pid);
if (!m_valgrindRunnable.device

View File

@@ -38,6 +38,7 @@
#include <projectexplorer/projectexplorericons.h>
#include <projectexplorer/runconfiguration.h>
#include <projectexplorer/runconfigurationaspects.h>
#include <QApplication>
@@ -85,6 +86,9 @@ void ValgrindToolRunner::start()
m_runner.setDevice(device());
m_runner.setDebuggee(runnable());
if (auto aspect = runControl()->runConfiguration()->extraAspect<TerminalAspect>())
m_runner.setUseTerminal(aspect->useTerminal());
connect(&m_runner, &ValgrindRunner::processOutputReceived,
this, &ValgrindToolRunner::receiveProcessOutput);
connect(&m_runner, &ValgrindRunner::valgrindExecuted,

View File

@@ -110,7 +110,6 @@ void ValgrindRunner::Private::run()
valgrind.executable = m_valgrindExecutable;
valgrind.workingDirectory = m_debuggee.workingDirectory;
valgrind.environment = m_debuggee.environment;
valgrind.runMode = m_debuggee.runMode;
valgrind.device = m_device;
valgrind.commandLineArguments = QtcProcess::joinArgs(fullArgs, m_device->osType());
Utils::QtcProcess::addArgs(&valgrind.commandLineArguments, m_debuggee.commandLineArguments);
@@ -258,6 +257,11 @@ void ValgrindRunner::setDevice(const IDevice::ConstPtr &device)
d->m_device = device;
}
void ValgrindRunner::setUseTerminal(bool on)
{
d->m_valgrindProcess.setUseTerminal(on);
}
void ValgrindRunner::waitForFinished() const
{
if (d->m_finished)

View File

@@ -50,6 +50,7 @@ public:
void setProcessChannelMode(QProcess::ProcessChannelMode mode);
void setLocalServerAddress(const QHostAddress &localServerAddress);
void setDevice(const ProjectExplorer::IDevice::ConstPtr &device);
void setUseTerminal(bool on);
void waitForFinished() const;