forked from qt-creator/qt-creator
QmlProfiler: Use LocalApplicationRunConfiguration
QmlProjectRunConfiguration is now derived from LocalApplicationRunConfiguration. Change-Id: Ieddac63ff9832771ed141c3f0aff1bcc0313f6bf Reviewed-by: hjk <hjk121@nokiamail.com>
This commit is contained in:
@@ -33,7 +33,6 @@
|
||||
|
||||
#include <analyzerbase/analyzerstartparameters.h>
|
||||
#include <projectexplorer/runconfiguration.h>
|
||||
#include <qmlprojectmanager/qmlprojectrunconfiguration.h>
|
||||
#include <projectexplorer/localapplicationrunconfiguration.h>
|
||||
#include <projectexplorer/environmentaspect.h>
|
||||
|
||||
@@ -47,28 +46,17 @@ LocalQmlProfilerRunner *LocalQmlProfilerRunner::createLocalRunner(
|
||||
QString *errorMessage,
|
||||
QmlProfilerRunControl *engine)
|
||||
{
|
||||
QmlProjectManager::QmlProjectRunConfiguration *rc1 =
|
||||
qobject_cast<QmlProjectManager::QmlProjectRunConfiguration *>(runConfiguration);
|
||||
LocalApplicationRunConfiguration *rc2 =
|
||||
LocalApplicationRunConfiguration *larc =
|
||||
qobject_cast<LocalApplicationRunConfiguration *>(runConfiguration);
|
||||
QTC_ASSERT(rc1 || rc2, return 0);
|
||||
QTC_ASSERT(larc, return 0);
|
||||
ProjectExplorer::EnvironmentAspect *environment
|
||||
= runConfiguration->extraAspect<ProjectExplorer::EnvironmentAspect>();
|
||||
QTC_ASSERT(environment, return 0);
|
||||
Configuration conf;
|
||||
if (rc1) {
|
||||
// This is a "plain" .qmlproject.
|
||||
conf.executable = rc1->executable();
|
||||
conf.executableArguments = rc1->commandLineArguments();
|
||||
conf.workingDirectory = rc1->workingDirectory();
|
||||
conf.environment = environment->environment();
|
||||
} else {
|
||||
// FIXME: Check.
|
||||
conf.executable = rc2->executable();
|
||||
conf.executableArguments = rc2->commandLineArguments();
|
||||
conf.workingDirectory = rc2->workingDirectory();
|
||||
conf.environment = environment->environment();
|
||||
}
|
||||
conf.executable = larc->executable();
|
||||
conf.executableArguments = larc->commandLineArguments();
|
||||
conf.workingDirectory = larc->workingDirectory();
|
||||
conf.environment = environment->environment();
|
||||
|
||||
conf.port = sp.analyzerPort;
|
||||
|
||||
|
||||
@@ -38,7 +38,6 @@
|
||||
#include <projectexplorer/projectexplorerconstants.h>
|
||||
#include <projectexplorer/kitinformation.h>
|
||||
#include <projectexplorer/target.h>
|
||||
#include <qmlprojectmanager/qmlprojectrunconfiguration.h>
|
||||
#include <qmlprojectmanager/qmlprojectplugin.h>
|
||||
#include <projectexplorer/environmentaspect.h>
|
||||
#include <projectexplorer/localapplicationruncontrol.h>
|
||||
@@ -111,8 +110,8 @@ bool QmlProfilerRunControl::startEngine()
|
||||
|
||||
d->m_profilerState->setCurrentState(QmlProfilerStateManager::AppStarting);
|
||||
|
||||
if (QmlProjectManager::QmlProjectRunConfiguration *rc =
|
||||
qobject_cast<QmlProjectManager::QmlProjectRunConfiguration *>(runConfiguration())) {
|
||||
if (ProjectExplorer::LocalApplicationRunConfiguration *rc =
|
||||
qobject_cast<ProjectExplorer::LocalApplicationRunConfiguration *>(runConfiguration())) {
|
||||
if (rc->executable().isEmpty()) {
|
||||
QmlProjectManager::QmlProjectPlugin::showQmlObserverToolWarning();
|
||||
d->m_profilerState->setCurrentState(QmlProfilerStateManager::Idle);
|
||||
|
||||
@@ -46,8 +46,6 @@
|
||||
#include <projectexplorer/session.h>
|
||||
#include <projectexplorer/target.h>
|
||||
|
||||
#include <qmlprojectmanager/qmlprojectrunconfiguration.h>
|
||||
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QTcpServer>
|
||||
@@ -66,8 +64,7 @@ QmlProfilerRunControlFactory::QmlProfilerRunControlFactory(QObject *parent) :
|
||||
bool QmlProfilerRunControlFactory::canRun(RunConfiguration *runConfiguration, RunMode mode) const
|
||||
{
|
||||
return mode == QmlProfilerRunMode
|
||||
&& (qobject_cast<QmlProjectManager::QmlProjectRunConfiguration *>(runConfiguration)
|
||||
|| qobject_cast<LocalApplicationRunConfiguration *>(runConfiguration));
|
||||
&& (qobject_cast<LocalApplicationRunConfiguration *>(runConfiguration));
|
||||
}
|
||||
|
||||
static AnalyzerStartParameters createQmlProfilerStartParameters(RunConfiguration *runConfiguration)
|
||||
@@ -76,27 +73,16 @@ static AnalyzerStartParameters createQmlProfilerStartParameters(RunConfiguration
|
||||
EnvironmentAspect *environment = runConfiguration->extraAspect<EnvironmentAspect>();
|
||||
|
||||
// FIXME: This is only used to communicate the connParams settings.
|
||||
if (QmlProjectManager::QmlProjectRunConfiguration *rc1 =
|
||||
qobject_cast<QmlProjectManager::QmlProjectRunConfiguration *>(runConfiguration)) {
|
||||
// This is a "plain" .qmlproject.
|
||||
if (environment)
|
||||
sp.environment = environment->environment();
|
||||
sp.workingDirectory = rc1->workingDirectory();
|
||||
sp.debuggee = rc1->executable();
|
||||
sp.debuggeeArgs = rc1->commandLineArguments();
|
||||
sp.displayName = rc1->displayName();
|
||||
} else if (LocalApplicationRunConfiguration *rc2 =
|
||||
qobject_cast<LocalApplicationRunConfiguration *>(runConfiguration)) {
|
||||
if (environment)
|
||||
sp.environment = environment->environment();
|
||||
sp.workingDirectory = rc2->workingDirectory();
|
||||
sp.debuggee = rc2->executable();
|
||||
sp.debuggeeArgs = rc2->commandLineArguments();
|
||||
sp.displayName = rc2->displayName();
|
||||
} else {
|
||||
// What could that be?
|
||||
QTC_ASSERT(false, return sp);
|
||||
}
|
||||
LocalApplicationRunConfiguration *rc =
|
||||
qobject_cast<LocalApplicationRunConfiguration *>(runConfiguration);
|
||||
QTC_ASSERT(rc, return sp);
|
||||
if (environment)
|
||||
sp.environment = environment->environment();
|
||||
sp.workingDirectory = rc->workingDirectory();
|
||||
sp.debuggee = rc->executable();
|
||||
sp.debuggeeArgs = rc->commandLineArguments();
|
||||
sp.displayName = rc->displayName();
|
||||
|
||||
const IDevice::ConstPtr device = DeviceKitInformation::device(runConfiguration->target()->kit());
|
||||
if (device->type() == ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE) {
|
||||
QTcpServer server;
|
||||
|
||||
Reference in New Issue
Block a user