QmlProfiler: Use StandardRunnable in LocalQmlProfilerRunner

Change-Id: I8c59f9dfe562717edd86453b0154b7f2811a06f3
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
This commit is contained in:
hjk
2016-01-27 16:02:28 +01:00
parent 5a090230a1
commit 07332eecb3
3 changed files with 17 additions and 24 deletions

View File

@@ -75,6 +75,12 @@ RunControl *QmlProfilerRunControlFactory::create(RunConfiguration *runConfigurat
QTC_ASSERT(runConfiguration->runnable().is<StandardRunnable>(), return 0);
auto runnable = runConfiguration->runnable().as<StandardRunnable>();
if (runnable.executable.isEmpty()) {
if (errorMessage)
*errorMessage = tr("No executable file to launch.");
return 0;
}
Kit *kit = runConfiguration->target()->kit();
AnalyzerConnection connection;
const QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(kit);
@@ -101,20 +107,10 @@ RunControl *QmlProfilerRunControlFactory::create(RunConfiguration *runConfigurat
runControl->setConnection(connection);
LocalQmlProfilerRunner::Configuration conf;
conf.executable = runnable.executable;
conf.executableArguments = runnable.commandLineArguments;
conf.workingDirectory = runnable.workingDirectory;
conf.debuggee = runnable;
conf.socket = connection.analyzerSocket;
if (EnvironmentAspect *environment = runConfiguration->extraAspect<EnvironmentAspect>())
conf.environment = environment->environment();
conf.port = connection.analyzerPort;
if (conf.executable.isEmpty()) {
if (errorMessage)
*errorMessage = tr("No executable file to launch.");
return 0;
}
(void) new LocalQmlProfilerRunner(conf, runControl);
return runControl;
}