aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/qmlprofiler/localqmlprofilerrunner.cpp
diff options
context:
space:
mode:
authorhjk <hjk@theqtcompany.com>2016-01-19 17:25:18 +0100
committerhjk <hjk@theqtcompany.com>2016-01-20 16:08:07 +0000
commit5dad96e3b71bb852f47477382ff0f9ac2f40b646 (patch)
tree4299a151d4aa4d3cfdf9f951be0b44414d0b623e /src/plugins/qmlprofiler/localqmlprofilerrunner.cpp
parente214eda80ef22abee1c9b1955289a1af9f7ff3bf (diff)
QmlProfiler: Adapt QmlProfilerRunControlFactory to Analyzer changes
Change-Id: I8047cdb3fc65df2139c1a5770218c48e83ef5f5a Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
Diffstat (limited to 'src/plugins/qmlprofiler/localqmlprofilerrunner.cpp')
-rw-r--r--src/plugins/qmlprofiler/localqmlprofilerrunner.cpp56
1 files changed, 8 insertions, 48 deletions
diff --git a/src/plugins/qmlprofiler/localqmlprofilerrunner.cpp b/src/plugins/qmlprofiler/localqmlprofilerrunner.cpp
index 385c2edc62..36c12f6901 100644
--- a/src/plugins/qmlprofiler/localqmlprofilerrunner.cpp
+++ b/src/plugins/qmlprofiler/localqmlprofilerrunner.cpp
@@ -27,9 +27,6 @@
#include "qmlprofilerplugin.h"
#include "qmlprofilerruncontrol.h"
-#include <analyzerbase/analyzermanager.h>
-#include <analyzerbase/analyzerruncontrol.h>
-#include <analyzerbase/analyzerstartparameters.h>
#include <projectexplorer/runconfiguration.h>
#include <projectexplorer/localapplicationrunconfiguration.h>
#include <projectexplorer/environmentaspect.h>
@@ -44,51 +41,6 @@
using namespace QmlProfiler;
using namespace ProjectExplorer;
-Analyzer::AnalyzerRunControl *LocalQmlProfilerRunner::createLocalRunControl(
- RunConfiguration *runConfiguration,
- const Analyzer::AnalyzerStartParameters &sp,
- QString *errorMessage)
-{
- // only desktop device is supported
- const IDevice::ConstPtr device = DeviceKitInformation::device(
- runConfiguration->target()->kit());
- QTC_ASSERT(device->type() == ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE, return 0);
-
- Analyzer::AnalyzerRunControl *rc = Analyzer::AnalyzerManager::createRunControl(
- sp, runConfiguration, ProjectExplorer::Constants::QML_PROFILER_RUN_MODE);
- QmlProfilerRunControl *engine = qobject_cast<QmlProfilerRunControl *>(rc);
- if (!engine) {
- delete rc;
- return 0;
- }
-
- Configuration conf;
- conf.executable = sp.debuggee;
- conf.executableArguments = sp.debuggeeArgs;
- conf.workingDirectory = rc->workingDirectory();
- conf.socket = sp.analyzerSocket;
- if (EnvironmentAspect *environment = runConfiguration->extraAspect<EnvironmentAspect>())
- conf.environment = environment->environment();
- conf.port = sp.analyzerPort;
-
- if (conf.executable.isEmpty()) {
- if (errorMessage)
- *errorMessage = tr("No executable file to launch.");
- return 0;
- }
-
- LocalQmlProfilerRunner *runner = new LocalQmlProfilerRunner(conf, engine);
-
- QObject::connect(runner, &LocalQmlProfilerRunner::stopped,
- engine, &QmlProfilerRunControl::notifyRemoteFinished);
- QObject::connect(runner, &LocalQmlProfilerRunner::appendMessage,
- engine, &QmlProfilerRunControl::logApplicationMessage);
- QObject::connect(engine, &Analyzer::AnalyzerRunControl::starting,
- runner, &LocalQmlProfilerRunner::start);
- QObject::connect(rc, &RunControl::finished, runner, &LocalQmlProfilerRunner::stop);
- return rc;
-}
-
QString LocalQmlProfilerRunner::findFreeSocket()
{
QTemporaryFile file;
@@ -120,6 +72,14 @@ LocalQmlProfilerRunner::LocalQmlProfilerRunner(const Configuration &configuratio
{
connect(&m_launcher, &ApplicationLauncher::appendMessage,
this, &LocalQmlProfilerRunner::appendMessage);
+ connect(this, &LocalQmlProfilerRunner::stopped,
+ engine, &QmlProfilerRunControl::notifyRemoteFinished);
+ connect(this, &LocalQmlProfilerRunner::appendMessage,
+ engine, &QmlProfilerRunControl::logApplicationMessage);
+ connect(engine, &Analyzer::AnalyzerRunControl::starting,
+ this, &LocalQmlProfilerRunner::start);
+ connect(engine, &RunControl::finished,
+ this, &LocalQmlProfilerRunner::stop);
}
LocalQmlProfilerRunner::~LocalQmlProfilerRunner()