ProjectExplorer: Use StandardRunnable in ApplicationLauncher

Change-Id: I7092d748207762d3dbd6c69c01cc06c88cbf63d8
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
This commit is contained in:
hjk
2016-01-27 16:56:36 +01:00
parent 9ffae7f4ba
commit d5ecd4cf8b
8 changed files with 53 additions and 68 deletions

View File

@@ -49,6 +49,7 @@
#include <coreplugin/icore.h>
#include <projectexplorer/applicationlauncher.h>
#include <projectexplorer/runnables.h>
#include <qmljseditor/qmljseditorconstants.h>
#include <qmljs/qmljsmodelmanagerinterface.h>
@@ -535,14 +536,17 @@ void QmlEngine::runEngine()
void QmlEngine::startApplicationLauncher()
{
if (!d->applicationLauncher.isRunning()) {
StandardRunnable runnable;
runnable.environment = runParameters().inferiorEnvironment;
runnable.workingDirectory = runParameters().workingDirectory;
runnable.executable = runParameters().executable;
runnable.commandLineArguments = runParameters().processArgs;
appendMessage(tr("Starting %1 %2").arg(
QDir::toNativeSeparators(runParameters().executable),
runParameters().processArgs)
QDir::toNativeSeparators(runnable.executable),
runnable.commandLineArguments)
+ QLatin1Char('\n')
, Utils::NormalMessageFormat);
d->applicationLauncher.start(ApplicationLauncher::Gui,
runParameters().executable,
runParameters().processArgs);
d->applicationLauncher.start(runnable);
}
}
@@ -635,9 +639,6 @@ void QmlEngine::setupEngine()
// we need to get the port first
notifyEngineRequestRemoteSetup();
} else {
d->applicationLauncher.setEnvironment(runParameters().inferiorEnvironment);
d->applicationLauncher.setWorkingDirectory(runParameters().workingDirectory);
// We can't do this in the constructore because runControl() isn't yet defined
connect(&d->applicationLauncher, &ApplicationLauncher::bringToForegroundRequested,
runControl(), &RunControl::bringApplicationToForeground,