Commit 1a82bedc authored by hjk's avatar hjk

QmlProfiler: Merge LocalQmlProfilerRunner and QmlProfilerRunner

Also streamline code paths in the result.

Change-Id: Id7d96343a8f778ba8f415b1a850cc78576afa475
Reviewed-by: Christian Stenger's avatarChristian Stenger <christian.stenger@qt.io>
parent 8116cb39
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3 as published by the Free Software
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
****************************************************************************/
#include "localqmlprofilerrunner.h"
#include "qmlprofilerplugin.h"
#include "qmlprofilerruncontrol.h"
#include <projectexplorer/runconfiguration.h>
#include <projectexplorer/environmentaspect.h>
#include <projectexplorer/devicesupport/idevice.h>
#include <projectexplorer/kitinformation.h>
#include <projectexplorer/projectexplorer.h>
#include <projectexplorer/target.h>
#include <qmldebug/qmldebugcommandlinearguments.h>
#include <utils/temporaryfile.h>
#include <QTcpServer>
#include <QTemporaryFile>
using namespace ProjectExplorer;
namespace QmlProfiler {
QString LocalQmlProfilerRunner::findFreeSocket()
{
Utils::TemporaryFile file("qmlprofiler-freesocket");
if (file.open()) {
return file.fileName();
} else {
qWarning() << "Could not open a temporary file to find a debug socket.";
return QString();
}
}
Utils::Port LocalQmlProfilerRunner::findFreePort(QString &host)
{
QTcpServer server;
if (!server.listen(QHostAddress::LocalHost)
&& !server.listen(QHostAddress::LocalHostIPv6)) {
qWarning() << "Cannot open port on host for QML profiling.";
return Utils::Port();
}
host = server.serverAddress().toString();
return Utils::Port(server.serverPort());
}
LocalQmlProfilerRunner::LocalQmlProfilerRunner(const Configuration &configuration,
QmlProfilerRunner *runner) :
QObject(runner->runControl()),
m_runControl(runner->runControl()),
m_configuration(configuration)
{
auto runControl = runner->runControl();
connect(&m_launcher, &ApplicationLauncher::appendMessage,
this, &LocalQmlProfilerRunner::appendMessage);
connect(this, &LocalQmlProfilerRunner::stopped,
runner, &QmlProfilerRunner::notifyRemoteFinished);
connect(this, &LocalQmlProfilerRunner::appendMessage,
runControl, &RunControl::appendMessage);
connect(runControl, &RunControl::starting,
this, &LocalQmlProfilerRunner::start);
connect(runControl, &RunControl::finished,
this, &LocalQmlProfilerRunner::stop);
m_outputParser.setNoOutputText(ApplicationLauncher::msgWinCannotRetrieveDebuggingOutput());
connect(runControl, &RunControl::appendMessageRequested,
this, [this](RunControl *runControl, const QString &msg, Utils::OutputFormat format) {
Q_UNUSED(runControl);
Q_UNUSED(format);
m_outputParser.processOutput(msg);
});
connect(&m_outputParser, &QmlDebug::QmlOutputParser::waitingForConnectionOnPort,
runControl, [this, runControl, runner](Utils::Port port) {
runControl->notifyRemoteSetupDone(port);
runner->notifyRemoteSetupDone(port);
});
connect(&m_outputParser, &QmlDebug::QmlOutputParser::noOutputMessage,
runControl, [this, runControl, runner]() {
runControl->notifyRemoteSetupDone(Utils::Port());
runner->notifyRemoteSetupDone(Utils::Port());
});
connect(&m_outputParser, &QmlDebug::QmlOutputParser::connectingToSocketMessage,
runControl, [this, runControl, runner]() {
runControl->notifyRemoteSetupDone(Utils::Port());
runner->notifyRemoteSetupDone(Utils::Port());
});
connect(&m_outputParser, &QmlDebug::QmlOutputParser::errorMessage,
runControl, [this, runControl, runner](const QString &message) {
runControl->notifyRemoteSetupFailed(message);
runner->notifyRemoteSetupFailed(message);
});
}
void LocalQmlProfilerRunner::start()
{
QTC_ASSERT(!m_configuration.socket.isEmpty() || m_configuration.port.isValid(), return);
StandardRunnable runnable = m_configuration.debuggee;
QString arguments = m_configuration.socket.isEmpty() ?
QmlDebug::qmlDebugTcpArguments(QmlDebug::QmlProfilerServices,
m_configuration.port) :
QmlDebug::qmlDebugLocalArguments(QmlDebug::QmlProfilerServices,
m_configuration.socket);
if (!m_configuration.debuggee.commandLineArguments.isEmpty())
arguments += QLatin1Char(' ') + m_configuration.debuggee.commandLineArguments;
runnable.commandLineArguments = arguments;
runnable.runMode = ApplicationLauncher::Gui;
// queue this, as the process can already die in the call to start().
// We want the started() signal to be emitted before the stopped() signal.
connect(&m_launcher, &ApplicationLauncher::processExited,
this, &LocalQmlProfilerRunner::spontaneousStop,
Qt::QueuedConnection);
m_launcher.start(runnable);
emit started();
}
void LocalQmlProfilerRunner::spontaneousStop(int exitCode, QProcess::ExitStatus status)
{
Q_UNUSED(exitCode);
Q_UNUSED(status);
disconnect(&m_launcher, &ApplicationLauncher::processExited,
this, &LocalQmlProfilerRunner::spontaneousStop);
emit stopped();
}
void LocalQmlProfilerRunner::stop()
{
if (m_launcher.isRunning())
m_launcher.stop();
}
} // namespace QmlProfiler
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3 as published by the Free Software
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
****************************************************************************/
#pragma once
#include "qmlprofiler_global.h"
#include <utils/environment.h>
#include <utils/port.h>
#include <projectexplorer/applicationlauncher.h>
#include <projectexplorer/runnables.h>
#include <qmldebug/qmloutputparser.h>
namespace QmlProfiler {
class QmlProfilerRunner;
class QMLPROFILER_EXPORT LocalQmlProfilerRunner : public QObject
{
Q_OBJECT
public:
struct Configuration {
ProjectExplorer::StandardRunnable debuggee;
Utils::Port port;
QString socket;
};
LocalQmlProfilerRunner(const Configuration &configuration,
QmlProfilerRunner *runner);
static Utils::Port findFreePort(QString &host);
static QString findFreeSocket();
signals:
void started();
void stopped();
void appendMessage(const QString &message, Utils::OutputFormat format);
private:
void spontaneousStop(int exitCode, QProcess::ExitStatus status);
void start();
void stop();
ProjectExplorer::RunControl *m_runControl;
Configuration m_configuration;
ProjectExplorer::ApplicationLauncher m_launcher;
QmlDebug::QmlOutputParser m_outputParser;
};
} // namespace QmlProfiler
......@@ -9,7 +9,6 @@ SOURCES += \
flamegraphmodel.cpp \
flamegraphview.cpp \
inputeventsmodel.cpp \
localqmlprofilerrunner.cpp \
memoryusagemodel.cpp \
pixmapcachemodel.cpp \
qmlevent.cpp \
......@@ -50,7 +49,6 @@ HEADERS += \
flamegraphmodel.h \
flamegraphview.h \
inputeventsmodel.h \
localqmlprofilerrunner.h \
memoryusagemodel.h \
pixmapcachemodel.h \
qmlevent.h \
......
......@@ -24,7 +24,6 @@ QtcPlugin {
"flamegraphmodel.cpp", "flamegraphmodel.h",
"flamegraphview.cpp", "flamegraphview.h",
"inputeventsmodel.cpp", "inputeventsmodel.h",
"localqmlprofilerrunner.cpp", "localqmlprofilerrunner.h",
"memoryusagemodel.cpp", "memoryusagemodel.h",
"pixmapcachemodel.cpp", "pixmapcachemodel.h",
"qmlevent.cpp", "qmlevent.h",
......
......@@ -37,6 +37,8 @@
#include <QObject>
#include <functional>
namespace ProjectExplorer { class RunConfiguration; }
namespace QmlProfiler {
class QmlProfilerModelManager;
class QmlProfilerNotesModel;
......
......@@ -23,9 +23,10 @@
**
****************************************************************************/
#include "qmlprofilerclientmanager.h"
#include "qmlprofilerruncontrol.h"
#include "localqmlprofilerrunner.h"
#include "qmlprofilertool.h"
#include "qmlprofilerplugin.h"
#include <debugger/analyzer/analyzermanager.h>
#include <debugger/analyzer/analyzerstartparameters.h>
......@@ -33,30 +34,38 @@
#include <coreplugin/icore.h>
#include <coreplugin/helpmanager.h>
#include <projectexplorer/devicesupport/idevice.h>
#include <projectexplorer/environmentaspect.h>
#include <projectexplorer/kitinformation.h>
#include <projectexplorer/localapplicationruncontrol.h>
#include <projectexplorer/projectexplorer.h>
#include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/projectexplorericons.h>
#include <projectexplorer/runconfiguration.h>
#include <projectexplorer/runnables.h>
#include <projectexplorer/target.h>
#include <qtsupport/qtsupportconstants.h>
#include <qmldebug/qmloutputparser.h>
#include <qmldebug/qmldebugcommandlinearguments.h>
#include <utils/qtcassert.h>
#include <utils/temporaryfile.h>
#include <QApplication>
#include <QMainWindow>
#include <QMessageBox>
#include <QTimer>
#include <QTcpServer>
#include <QApplication>
#include <QMessageBox>
#include <QPushButton>
#include <QTcpServer>
#include <QTemporaryFile>
#include <QTimer>
using namespace Debugger;
using namespace Core;
using namespace ProjectExplorer;
using namespace QmlProfiler::Internal;
namespace QmlProfiler {
......@@ -69,6 +78,10 @@ class QmlProfilerRunner::QmlProfilerRunnerPrivate
public:
QmlProfilerStateManager *m_profilerState = 0;
QTimer m_noDebugOutputTimer;
bool m_isLocal = false;
QmlProfilerRunner::Configuration m_configuration;
ProjectExplorer::ApplicationLauncher m_launcher;
QmlDebug::QmlOutputParser m_outputParser;
};
//
......@@ -100,20 +113,48 @@ QmlProfilerRunner::~QmlProfilerRunner()
void QmlProfilerRunner::start()
{
runControl()->reportApplicationStart();
Internal::QmlProfilerTool::instance()->finalizeRunControl(this);
QTC_ASSERT(d->m_profilerState, runControl()->reportApplicationStop(); return);
QTC_ASSERT(d->m_profilerState, return);
QTC_ASSERT(connection().is<AnalyzerConnection>(), runControl()->reportApplicationStop(); return);
QTC_ASSERT(connection().is<AnalyzerConnection>(), return);
auto conn = connection().as<AnalyzerConnection>();
if (conn.analyzerPort.isValid())
emit processRunning(conn.analyzerPort);
if (conn.analyzerPort.isValid()) {
auto clientManager = Internal::QmlProfilerTool::clientManager();
clientManager->setTcpConnection(conn.analyzerHost, conn.analyzerPort);
clientManager->connectToTcpServer();
}
else if (conn.analyzerSocket.isEmpty())
d->m_noDebugOutputTimer.start();
d->m_profilerState->setCurrentState(QmlProfilerStateManager::AppRunning);
emit runControl()->starting();
if (d->m_isLocal) {
QTC_ASSERT(!d->m_configuration.socket.isEmpty() || d->m_configuration.port.isValid(), return);
StandardRunnable debuggee = runnable().as<StandardRunnable>();
QString arguments = d->m_configuration.socket.isEmpty() ?
QmlDebug::qmlDebugTcpArguments(QmlDebug::QmlProfilerServices,
d->m_configuration.port) :
QmlDebug::qmlDebugLocalArguments(QmlDebug::QmlProfilerServices,
d->m_configuration.socket);
if (!debuggee.commandLineArguments.isEmpty())
arguments += ' ' + debuggee.commandLineArguments;
debuggee.commandLineArguments = arguments;
debuggee.runMode = ApplicationLauncher::Gui;
// queue this, as the process can already die in the call to start().
// We want the started() signal to be emitted before the stopped() signal.
connect(&d->m_launcher, &ApplicationLauncher::processExited,
this, &QmlProfilerRunner::spontaneousStop,
Qt::QueuedConnection);
d->m_launcher.start(debuggee);
emit localRunnerStarted();
}
}
void QmlProfilerRunner::stop()
......@@ -148,7 +189,6 @@ void QmlProfilerRunner::notifyRemoteFinished()
switch (d->m_profilerState->currentState()) {
case QmlProfilerStateManager::AppRunning:
d->m_profilerState->setCurrentState(QmlProfilerStateManager::AppDying);
runControl()->reportApplicationStop();
break;
case QmlProfilerStateManager::Idle:
break;
......@@ -177,7 +217,7 @@ void QmlProfilerRunner::cancelProcess()
return;
}
}
runControl()->reportApplicationStop();
runControl()->initiateStop();
}
void QmlProfilerRunner::notifyRemoteSetupFailed(const QString &errorMessage)
......@@ -200,7 +240,6 @@ void QmlProfilerRunner::notifyRemoteSetupFailed(const QString &errorMessage)
// KILL
d->m_profilerState->setCurrentState(QmlProfilerStateManager::AppDying);
d->m_noDebugOutputTimer.stop();
runControl()->reportApplicationStop();
}
void QmlProfilerRunner::wrongSetupMessageBoxFinished(int button)
......@@ -219,8 +258,11 @@ void QmlProfilerRunner::notifyRemoteSetupDone(Utils::Port port)
QTC_ASSERT(connection().is<AnalyzerConnection>(), return);
port = connection().as<AnalyzerConnection>().analyzerPort;
}
if (port.isValid())
emit processRunning(port);
if (port.isValid()) {
auto clientManager = Internal::QmlProfilerTool::clientManager();
clientManager->setTcpConnection(connection().as<AnalyzerConnection>().analyzerHost, port);
clientManager->connectToTcpServer();
}
}
void QmlProfilerRunner::registerProfilerStateManager( QmlProfilerStateManager *profilerState )
......@@ -242,7 +284,6 @@ void QmlProfilerRunner::profilerStateChanged()
{
switch (d->m_profilerState->currentState()) {
case QmlProfilerStateManager::Idle:
runControl()->reportApplicationStop();
d->m_noDebugOutputTimer.stop();
break;
default:
......@@ -250,4 +291,82 @@ void QmlProfilerRunner::profilerStateChanged()
}
}
QString QmlProfilerRunner::findFreeSocket()
{
Utils::TemporaryFile file("qmlprofiler-freesocket");
if (file.open()) {
return file.fileName();
} else {
qWarning() << "Could not open a temporary file to find a debug socket.";
return QString();
}
}
Utils::Port QmlProfilerRunner::findFreePort(QString &host)
{
QTcpServer server;
if (!server.listen(QHostAddress::LocalHost)
&& !server.listen(QHostAddress::LocalHostIPv6)) {
qWarning() << "Cannot open port on host for QML profiling.";
return Utils::Port();
}
host = server.serverAddress().toString();
return Utils::Port(server.serverPort());
}
void QmlProfilerRunner::setLocalConfiguration(const Configuration &configuration)
{
d->m_isLocal = true;
d->m_configuration = configuration;
connect(&d->m_launcher, &ApplicationLauncher::appendMessage,
this, &QmlProfilerRunner::appendMessage);
connect(this, &QmlProfilerRunner::localRunnerStopped,
this, &QmlProfilerRunner::notifyRemoteFinished);
connect(runControl(), &RunControl::finished,
this, &QmlProfilerRunner::stopLocalRunner);
d->m_outputParser.setNoOutputText(ApplicationLauncher::msgWinCannotRetrieveDebuggingOutput());
connect(runControl(), &RunControl::appendMessageRequested,
this, [this](RunControl *, const QString &msg, Utils::OutputFormat) {
d->m_outputParser.processOutput(msg);
});
connect(&d->m_outputParser, &QmlDebug::QmlOutputParser::waitingForConnectionOnPort,
this, [this](Utils::Port port) {
notifyRemoteSetupDone(port);
});
connect(&d->m_outputParser, &QmlDebug::QmlOutputParser::noOutputMessage,
this, [this] {
notifyRemoteSetupDone(Utils::Port());
});
connect(&d->m_outputParser, &QmlDebug::QmlOutputParser::connectingToSocketMessage,
this, [this] {
notifyRemoteSetupDone(Utils::Port());
});
connect(&d->m_outputParser, &QmlDebug::QmlOutputParser::errorMessage,
this, [this](const QString &message) {
notifyRemoteSetupFailed(message);
});
}
void QmlProfilerRunner::spontaneousStop(int exitCode, QProcess::ExitStatus status)
{
Q_UNUSED(exitCode);
Q_UNUSED(status);
disconnect(&d->m_launcher, &ApplicationLauncher::processExited,
this, &QmlProfilerRunner::spontaneousStop);
emit localRunnerStopped();
}
void QmlProfilerRunner::stopLocalRunner()
{
if (d->m_launcher.isRunning())
d->m_launcher.stop();
}
} // namespace QmlProfiler
......@@ -28,7 +28,12 @@
#include "qmlprofilerstatemanager.h"
#include <projectexplorer/runconfiguration.h>
#include <projectexplorer/runnables.h>
#include <utils/outputformat.h>
#include <utils/port.h>
#include <qmldebug/qmloutputparser.h>
namespace QmlProfiler {
......@@ -40,22 +45,37 @@ public:
QmlProfilerRunner(ProjectExplorer::RunControl *runControl);
~QmlProfilerRunner() override;
struct Configuration {
Utils::Port port;
QString socket;
};
void setLocalConfiguration(const Configuration &conf);
void registerProfilerStateManager( QmlProfilerStateManager *profilerState );
void notifyRemoteSetupDone(Utils::Port port);
void notifyRemoteSetupFailed(const QString &errorMessage);
void start() override;
void stop() override;
void cancelProcess();
void notifyRemoteFinished();
static Utils::Port findFreePort(QString &host);
static QString findFreeSocket();
signals:
void processRunning(Utils::Port port);
void localRunnerStarted();
void localRunnerStopped();
private:
void start() override;
void stop() override;
void wrongSetupMessageBoxFinished(int);
void profilerStateChanged();
void spontaneousStop(int exitCode, QProcess::ExitStatus status);
void startLocalRunner();
void stopLocalRunner();
class QmlProfilerRunnerPrivate;
QmlProfilerRunnerPrivate *d;
};
......
......@@ -24,7 +24,6 @@
****************************************************************************/
#include "qmlprofilerruncontrolfactory.h"
#include "localqmlprofilerrunner.h"
#include "qmlprofilerruncontrol.h"
#include "qmlprofilerrunconfigurationaspect.h"
......@@ -60,6 +59,8 @@ static bool isLocal(RunConfiguration *runConfiguration)
QmlProfilerRunControlFactory::QmlProfilerRunControlFactory(QObject *parent) :
IRunControlFactory(parent)
{
RunControl::registerWorkerCreator(ProjectExplorer::Constants::QML_PROFILER_RUN_MODE,
[this](RunControl *runControl) { return new QmlProfilerRunner(runControl); });
}
bool QmlProfilerRunControlFactory::canRun(RunConfiguration *runConfiguration, Core::Id mode) const
......@@ -67,44 +68,33 @@ bool QmlProfilerRunControlFactory::canRun(RunConfiguration *runConfiguration, Co
return mode == ProjectExplorer::Constants::QML_PROFILER_RUN_MODE && isLocal(runConfiguration);
}
RunControl *QmlProfilerRunControlFactory::create(RunConfiguration *runConfiguration, Core::Id mode, QString *errorMessage)
RunControl *QmlProfilerRunControlFactory::create(RunConfiguration *runConfiguration, Core::Id mode, QString *)
{
QTC_ASSERT(canRun(runConfiguration, mode), return 0);
QTC_ASSERT(runConfiguration->runnable().is<StandardRunnable>(), return 0);
auto runnable = runConfiguration->runnable().as<StandardRunnable>();
if (runnable.executable.isEmpty()) {
if (errorMessage)
*errorMessage = tr("No executable file to launch.");
return 0;
}
Kit *kit = runConfiguration->target()->kit();
AnalyzerConnection connection;
const QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(kit);
if (version) {
if (version->qtVersion() >= QtSupport::QtVersionNumber(5, 6, 0))
connection.analyzerSocket = LocalQmlProfilerRunner::findFreeSocket();
connection.analyzerSocket = QmlProfilerRunner::findFreeSocket();
else
connection.analyzerPort = LocalQmlProfilerRunner::findFreePort(connection.analyzerHost);
connection.analyzerPort = QmlProfilerRunner::findFreePort(connection.analyzerHost);
} else {
qWarning() << "Running QML profiler on Kit without Qt version??";
connection.analyzerPort = LocalQmlProfilerRunner::findFreePort(connection.analyzerHost);
connection.analyzerPort = QmlProfilerRunner::findFreePort(connection.analyzerHost);
}
auto runControl = new RunControl(runConfiguration, ProjectExplorer::Constants::QML_PROFILER_RUN_MODE);
auto runWorker = runControl->createWorker(ProjectExplorer::Constants::QML_PROFILER_RUN_MODE);
runControl->setRunnable(runnable);
runControl->setConnection(connection);
LocalQmlProfilerRunner::Configuration conf;
conf.debuggee = runnable;
if (EnvironmentAspect *environment = runConfiguration->extraAspect<EnvironmentAspect>())
conf.debuggee.environment = environment->environment();
QmlProfilerRunner::Configuration conf;
conf.socket = connection.analyzerSocket;
conf.port = connection.analyzerPort;
(void) new LocalQmlProfilerRunner(conf, qobject_cast<QmlProfilerRunner *>(runWorker));
auto runner = new QmlProfilerRunner(runControl);
runner->setLocalConfiguration(conf);
return runControl;
}
......
......@@ -25,8 +25,9 @@
#include "qmlprofilertextmark.h"
#include "qmlprofilerconstants.h"
#include <QPainter>
#include <QLabel>
#include <QLayout>
#include <QPainter>
namespace QmlProfiler {
namespace Internal {
......
......@@ -247,17 +247,12 @@ QmlProfilerTool::QmlProfilerTool(QObject *parent)
// is available, then we can populate the file finder
d->m_profilerModelManager->populateFileFinder();
auto runWorkerCreator = [this](RunControl *runControl) {
return createRunner(runControl, Debugger::startupRunConfiguration());
};
QString description = tr("The QML Profiler can be used to find performance "
"bottlenecks in applications using QML.");
d->m_startAction = Debugger::createStartAction();
d->m_stopAction = Debugger::createStopAction();
RunControl::registerWorkerCreator(ProjectExplorer::Constants::QML_PROFILER_RUN_MODE, runWorkerCreator);
act = new QAction(tr("QML Profiler"), this);
act->setToolTip(description);
menu->addAction(ActionManager::registerAction(act, "QmlProfiler.Local"),
......@@ -328,11 +323,13 @@ void QmlProfilerTool::updateRunActions()
}
}
RunWorker *QmlProfilerTool::createRunner(RunControl *runControl, RunConfiguration *runConfiguration)
void QmlProfilerTool::finalizeRunControl(QmlProfilerRunner *runWorker)
{
d->m_toolBusy = true;
auto runControl = runWorker->runControl();
auto runConfiguration = runControl->runConfiguration();
if (runConfiguration) {
QmlProfilerRunConfigurationAspect *aspect = static_cast<QmlProfilerRunConfigurationAspect *>(
auto aspect = static_cast<QmlProfilerRunConfigurationAspect *>(
runConfiguration->extraAspect(Constants::SETTINGS));
if (aspect) {
if (QmlProfilerSettings *settings = static_cast<QmlProfilerSettings *>(aspect->currentSettings())) {
......@@ -343,7 +340,6 @@ RunWorker *QmlProfilerTool::createRunner(RunControl *runControl, RunConfiguratio
}
}
auto runWorker = new QmlProfilerRunner(runControl);
connect(runControl, &RunControl::finished, this, [this, runControl] {
d->m_toolBusy = false;
updateRunActions();
......@@ -353,11 +349,6 @@ RunWorker *QmlProfilerTool::createRunner(RunControl *runControl, RunConfiguratio
connect(d->m_stopAction, &QAction::triggered, runControl, &RunControl::stop);
updateRunActions();
return runWorker;
}
void QmlProfilerTool::finalizeRunControl(QmlProfilerRunner *runWorker)
{
runWorker->registerProfilerStateManager(d->m_profilerState);
QmlProfilerClientManager *clientManager = d->m_profilerConnections;
......@@ -376,20 +367,10 @@ void QmlProfilerTool::finalizeRunControl(QmlProfilerRunner *runWorker)