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:
hjk
2016-01-25 15:00:20 +01:00
parent 4ea8caccf2
commit 9ae2ce7629
28 changed files with 244 additions and 318 deletions

View File

@@ -28,7 +28,6 @@
#include "qmlprofilerruncontrol.h"
#include <projectexplorer/runconfiguration.h>
#include <projectexplorer/localapplicationrunconfiguration.h>
#include <projectexplorer/environmentaspect.h>
#include <projectexplorer/devicesupport/idevice.h>
#include <projectexplorer/kitinformation.h>

View File

@@ -37,7 +37,7 @@
#include <projectexplorer/target.h>
#include <projectexplorer/environmentaspect.h>
#include <projectexplorer/localapplicationruncontrol.h>
#include <projectexplorer/localapplicationrunconfiguration.h>
#include <projectexplorer/runnables.h>
#include <qtsupport/qtsupportconstants.h>
#include <qmldebug/qmloutputparser.h>

View File

@@ -36,7 +36,7 @@
#include <projectexplorer/environmentaspect.h>
#include <projectexplorer/kitinformation.h>
#include <projectexplorer/localapplicationrunconfiguration.h>
#include <projectexplorer/runnables.h>
#include <projectexplorer/projectexplorer.h>
#include <projectexplorer/project.h>
#include <projectexplorer/session.h>
@@ -52,6 +52,13 @@ using namespace ProjectExplorer;
namespace QmlProfiler {
namespace Internal {
static bool isLocal(RunConfiguration *runConfiguration)
{
Target *target = runConfiguration ? runConfiguration->target() : 0;
Kit *kit = target ? target->kit() : 0;
return DeviceTypeKitInformation::deviceTypeId(kit) == ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE;
}
QmlProfilerRunControlFactory::QmlProfilerRunControlFactory(QObject *parent) :
IRunControlFactory(parent)
{
@@ -59,22 +66,19 @@ QmlProfilerRunControlFactory::QmlProfilerRunControlFactory(QObject *parent) :
bool QmlProfilerRunControlFactory::canRun(RunConfiguration *runConfiguration, Core::Id mode) const
{
return mode == ProjectExplorer::Constants::QML_PROFILER_RUN_MODE
&& (qobject_cast<LocalApplicationRunConfiguration *>(runConfiguration));
return mode == ProjectExplorer::Constants::QML_PROFILER_RUN_MODE && isLocal(runConfiguration);
}
RunControl *QmlProfilerRunControlFactory::create(RunConfiguration *runConfiguration, Core::Id mode, QString *errorMessage)
{
QTC_ASSERT(canRun(runConfiguration, mode), return 0);
QTC_ASSERT(runConfiguration->runnable().is<StandardRunnable>(), return 0);
auto &rcRunnable = runConfiguration->runnable().as<StandardRunnable>();
AnalyzerRunnable runnable;
runnable.debuggee = rcRunnable.executable;
runnable.debuggeeArgs = rcRunnable.commandLineArguments;
Kit *kit = runConfiguration->target()->kit();
// FIXME: This is only used to communicate the connParams settings.
auto localRunConfiguration = qobject_cast<LocalApplicationRunConfiguration *>(runConfiguration);
QTC_ASSERT(localRunConfiguration, return 0);
AnalyzerRunnable runnable;
runnable.debuggee = localRunConfiguration->executable();
runnable.debuggeeArgs = localRunConfiguration->commandLineArguments();
AnalyzerConnection connection;
const QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(kit);
if (version) {

View File

@@ -49,7 +49,7 @@
#include <projectexplorer/target.h>
#include <projectexplorer/session.h>
#include <projectexplorer/kitinformation.h>
#include <projectexplorer/localapplicationrunconfiguration.h>
#include <projectexplorer/runnables.h>
#include <texteditor/texteditor.h>
#include <coreplugin/coreconstants.h>