Finish merging Runnable and StandardRunnable

As all Runnables are known to be StandardRunnables, this here
essentially replaces all .is<StandardRunnable> by 'true'.
.as<StandardRunnable> by no-op, and fixes the fallout.

Change-Id: I1632f8e164fa0a9dff063df47a9e191fdf7bbb2e
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
hjk
2018-05-16 15:42:03 +02:00
parent fdccc54275
commit 36b835ff0a
73 changed files with 147 additions and 286 deletions

View File

@@ -44,7 +44,6 @@
#include <projectexplorer/project.h>
#include <projectexplorer/projectexplorer.h>
#include <projectexplorer/projectexplorericons.h>
#include <projectexplorer/runnables.h>
#include <projectexplorer/runconfigurationaspects.h>
#include <projectexplorer/session.h>
#include <projectexplorer/target.h>
@@ -93,7 +92,7 @@ class LocalProcessRunner : public RunWorker
Q_DECLARE_TR_FUNCTIONS(Debugger::Internal::LocalProcessRunner)
public:
LocalProcessRunner(RunControl *runControl, const StandardRunnable &runnable)
LocalProcessRunner(RunControl *runControl, const Runnable &runnable)
: RunWorker(runControl), m_runnable(runnable)
{
connect(&m_proc, &QProcess::errorOccurred,
@@ -177,7 +176,7 @@ public:
Core::AsynchronousMessageBox::critical(tr("Error"), msg);
}
StandardRunnable m_runnable;
Runnable m_runnable;
Utils::QtcProcess m_proc;
};
@@ -395,7 +394,7 @@ void DebuggerRunTool::setServerStartScript(const QString &serverStartScript)
{
if (!serverStartScript.isEmpty()) {
// Provide script information about the environment
StandardRunnable serverStarter;
Runnable serverStarter;
serverStarter.executable = serverStartScript;
QtcProcess::addArg(&serverStarter.commandLineArguments, m_runParameters.inferior.executable);
QtcProcess::addArg(&serverStarter.commandLineArguments, m_runParameters.remoteChannel);
@@ -435,8 +434,7 @@ void DebuggerRunTool::setOverrideStartScript(const QString &script)
void DebuggerRunTool::setInferior(const Runnable &runnable)
{
QTC_ASSERT(runnable.is<StandardRunnable>(), reportFailure(); return);
m_runParameters.inferior = runnable.as<StandardRunnable>();
m_runParameters.inferior = runnable;
setUseTerminal(m_runParameters.inferior.runMode == ApplicationLauncher::Console);
}
@@ -852,14 +850,11 @@ DebuggerRunTool::DebuggerRunTool(RunControl *runControl, Kit *kit, bool allowTer
if (m_runParameters.isCppDebugging)
m_runParameters.cppEngineType = DebuggerKitInformation::engineType(kit);
Runnable r = runnable();
if (r.is<StandardRunnable>()) {
m_runParameters.inferior = r.as<StandardRunnable>();
// Normalize to work around QTBUG-17529 (QtDeclarative fails with 'File name case mismatch'...)
m_runParameters.inferior.workingDirectory =
FileUtils::normalizePathName(m_runParameters.inferior.workingDirectory);
setUseTerminal(allowTerminal && m_runParameters.inferior.runMode == ApplicationLauncher::Console);
}
m_runParameters.inferior = runnable();
// Normalize to work around QTBUG-17529 (QtDeclarative fails with 'File name case mismatch'...)
m_runParameters.inferior.workingDirectory =
FileUtils::normalizePathName(m_runParameters.inferior.workingDirectory);
setUseTerminal(allowTerminal && m_runParameters.inferior.runMode == ApplicationLauncher::Console);
const QByteArray envBinary = qgetenv("QTC_DEBUGGER_PATH");
if (!envBinary.isEmpty())
@@ -1005,8 +1000,7 @@ GdbServerRunner::GdbServerRunner(RunControl *runControl, GdbServerPortsGatherer
: SimpleTargetRunner(runControl), m_portsGatherer(portsGatherer)
{
setDisplayName("GdbServerRunner");
if (runControl->runnable().is<StandardRunnable>())
m_runnable = runControl->runnable().as<StandardRunnable>();
m_runnable = runControl->runnable();
addStartDependency(m_portsGatherer);
}
@@ -1014,7 +1008,7 @@ GdbServerRunner::~GdbServerRunner()
{
}
void GdbServerRunner::setRunnable(const StandardRunnable &runnable)
void GdbServerRunner::setRunnable(const Runnable &runnable)
{
m_runnable = runnable;
}
@@ -1033,7 +1027,7 @@ void GdbServerRunner::start()
{
QTC_ASSERT(m_portsGatherer, reportFailure(); return);
StandardRunnable gdbserver;
Runnable gdbserver;
gdbserver.environment = m_runnable.environment;
gdbserver.workingDirectory = m_runnable.workingDirectory;