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:
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user