forked from qt-creator/qt-creator
ProjectExplorer: Drop LocalApplicationRunConfiguration
The functionality can be provided by producing a suitable Runnable in the derived classes directly. Change-Id: I7b8e8fe33fffd2b00176b6cf6633eca4e152e466 Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
This commit is contained in:
@@ -41,7 +41,7 @@
|
||||
|
||||
#include <debugger/debuggerrunconfigurationaspect.h>
|
||||
#include <projectexplorer/environmentaspect.h>
|
||||
#include <projectexplorer/localapplicationrunconfiguration.h>
|
||||
#include <projectexplorer/runnables.h>
|
||||
#include <projectexplorer/kitinformation.h>
|
||||
#include <projectexplorer/projectexplorer.h>
|
||||
#include <projectexplorer/target.h>
|
||||
@@ -75,21 +75,19 @@ RunControl *ValgrindRunControlFactory::create(RunConfiguration *runConfiguration
|
||||
QTC_ASSERT(runControl, return 0);
|
||||
|
||||
ApplicationLauncher::Mode localRunMode = ApplicationLauncher::Gui;
|
||||
IDevice::ConstPtr device = DeviceKitInformation::device(runConfiguration->target()->kit());
|
||||
Utils::Environment environment;
|
||||
AnalyzerRunnable runnable;
|
||||
AnalyzerConnection connection;
|
||||
QString workingDirectory;
|
||||
if (auto rc1 = qobject_cast<LocalApplicationRunConfiguration *>(runConfiguration)) {
|
||||
EnvironmentAspect *aspect = runConfiguration->extraAspect<EnvironmentAspect>();
|
||||
if (aspect)
|
||||
environment = aspect->environment();
|
||||
workingDirectory = rc1->workingDirectory();
|
||||
runnable.debuggee = rc1->executable();
|
||||
runnable.debuggeeArgs = rc1->commandLineArguments();
|
||||
const IDevice::ConstPtr device =
|
||||
DeviceKitInformation::device(runConfiguration->target()->kit());
|
||||
QTC_ASSERT(device, return 0);
|
||||
QTC_ASSERT(device->type() == ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE, return 0);
|
||||
Runnable rcRunnable = runConfiguration->runnable();
|
||||
if (rcRunnable.is<StandardRunnable>()
|
||||
&& device->type() == ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE) {
|
||||
auto stdRunnable = runConfiguration->runnable().as<StandardRunnable>();
|
||||
environment = stdRunnable.environment;
|
||||
workingDirectory = stdRunnable.workingDirectory;
|
||||
runnable.debuggee = stdRunnable.executable;
|
||||
runnable.debuggeeArgs = stdRunnable.commandLineArguments;
|
||||
QTcpServer server;
|
||||
if (!server.listen(QHostAddress::LocalHost) && !server.listen(QHostAddress::LocalHostIPv6)) {
|
||||
qWarning() << "Cannot open port on host for profiling.";
|
||||
@@ -97,11 +95,11 @@ RunControl *ValgrindRunControlFactory::create(RunConfiguration *runConfiguration
|
||||
}
|
||||
connection.connParams.host = server.serverAddress().toString();
|
||||
connection.connParams.port = server.serverPort();
|
||||
localRunMode = rc1->runMode();
|
||||
localRunMode = stdRunnable.runMode;
|
||||
} else if (auto rc2 = qobject_cast<RemoteLinux::AbstractRemoteLinuxRunConfiguration *>(runConfiguration)) {
|
||||
runnable.debuggee = rc2->remoteExecutableFilePath();
|
||||
runnable.debuggeeArgs = rc2->arguments();
|
||||
connection.connParams = DeviceKitInformation::device(rc2->target()->kit())->sshParameters();
|
||||
connection.connParams = device->sshParameters();
|
||||
} else {
|
||||
QTC_ASSERT(false, return 0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user