Commit 03c184c6 authored by Ulf Hermann's avatar Ulf Hermann

RemoteLinux: Generalize QML tooling support

The only thing about RemoteLinuxAnalyzeSupport that's actually specific
to the QML profiler is the debug services preset.

Change-Id: I1360f9555b18b74d9a86799900b58ce69e3bc205
Reviewed-by: default avatarhjk <hjk@qt.io>
parent 8e4b35b0
......@@ -42,7 +42,7 @@ HEADERS += \
genericlinuxdeviceconfigurationwidget.h \
remotelinuxcheckforfreediskspaceservice.h \
remotelinuxcheckforfreediskspacestep.h \
remotelinuxanalyzesupport.h \
remotelinuxqmltoolingsupport.h \
linuxdeviceprocess.h \
remotelinuxcustomrunconfiguration.h \
remotelinuxsignaloperation.h \
......@@ -86,7 +86,7 @@ SOURCES += \
genericlinuxdeviceconfigurationwidget.cpp \
remotelinuxcheckforfreediskspaceservice.cpp \
remotelinuxcheckforfreediskspacestep.cpp \
remotelinuxanalyzesupport.cpp \
remotelinuxqmltoolingsupport.cpp \
linuxdeviceprocess.cpp \
remotelinuxcustomrunconfiguration.cpp \
remotelinuxsignaloperation.cpp \
......
......@@ -60,8 +60,6 @@ Project {
"remotelinux.qrc",
"remotelinux_constants.h",
"remotelinux_export.h",
"remotelinuxanalyzesupport.cpp",
"remotelinuxanalyzesupport.h",
"remotelinuxcheckforfreediskspaceservice.cpp",
"remotelinuxcheckforfreediskspaceservice.h",
"remotelinuxcheckforfreediskspacestep.cpp",
......@@ -90,6 +88,8 @@ Project {
"remotelinuxpackageinstaller.h",
"remotelinuxplugin.cpp",
"remotelinuxplugin.h",
"remotelinuxqmltoolingsupport.cpp",
"remotelinuxqmltoolingsupport.h",
"remotelinuxrunconfiguration.cpp",
"remotelinuxrunconfiguration.h",
"remotelinuxrunconfigurationfactory.cpp",
......
......@@ -28,7 +28,7 @@
#include "embeddedlinuxqtversionfactory.h"
#include "genericlinuxdeviceconfigurationfactory.h"
#include "genericremotelinuxdeploystepfactory.h"
#include "remotelinuxanalyzesupport.h"
#include "remotelinuxqmltoolingsupport.h"
#include "remotelinuxcustomrunconfiguration.h"
#include "remotelinuxdebugsupport.h"
#include "remotelinuxdeployconfigurationfactory.h"
......
......@@ -23,13 +23,12 @@
**
****************************************************************************/
#include "remotelinuxanalyzesupport.h"
#include "remotelinuxqmltoolingsupport.h"
#include <projectexplorer/runnables.h>
#include <ssh/sshconnection.h>
#include <qmldebug/qmldebugcommandlinearguments.h>
#include <utils/url.h>
using namespace ProjectExplorer;
using namespace Utils;
......@@ -39,10 +38,11 @@ namespace Internal {
// RemoteLinuxQmlProfilerSupport
RemoteLinuxQmlProfilerSupport::RemoteLinuxQmlProfilerSupport(RunControl *runControl)
: SimpleTargetRunner(runControl)
RemoteLinuxQmlToolingSupport::RemoteLinuxQmlToolingSupport(
RunControl *runControl, QmlDebug::QmlDebugServicesPreset services)
: SimpleTargetRunner(runControl), m_services(services)
{
setDisplayName("RemoteLinuxQmlProfilerSupport");
setDisplayName("RemoteLinuxQmlToolingSupport");
m_portsGatherer = new PortsGatherer(runControl);
addStartDependency(m_portsGatherer);
......@@ -51,21 +51,22 @@ RemoteLinuxQmlProfilerSupport::RemoteLinuxQmlProfilerSupport(RunControl *runCont
// be started before.
addStopDependency(m_portsGatherer);
m_profiler = runControl->createWorker(runControl->runMode());
m_profiler->addStartDependency(this);
addStopDependency(m_profiler);
m_runworker = runControl->createWorker(runControl->runMode());
m_runworker->addStartDependency(this);
addStopDependency(m_runworker);
}
void RemoteLinuxQmlProfilerSupport::start()
void RemoteLinuxQmlToolingSupport::start()
{
Port qmlPort = m_portsGatherer->findPort();
QUrl serverUrl;
serverUrl.setScheme(urlTcpScheme());
serverUrl.setHost(device()->sshParameters().host);
serverUrl.setPort(qmlPort.number());
m_profiler->recordData("QmlServerUrl", serverUrl);
m_runworker->recordData("QmlServerUrl", serverUrl);
QString args = QmlDebug::qmlDebugTcpArguments(QmlDebug::QmlProfilerServices, qmlPort);
QString args = QmlDebug::qmlDebugTcpArguments(m_services, qmlPort);
auto r = runnable().as<StandardRunnable>();
if (!r.commandLineArguments.isEmpty())
r.commandLineArguments.append(' ');
......
......@@ -27,20 +27,31 @@
#include <projectexplorer/devicesupport/deviceusedportsgatherer.h>
#include <projectexplorer/runconfiguration.h>
#include <qmldebug/qmldebugcommandlinearguments.h>
namespace RemoteLinux {
namespace Internal {
class RemoteLinuxQmlProfilerSupport : public ProjectExplorer::SimpleTargetRunner
class RemoteLinuxQmlToolingSupport : public ProjectExplorer::SimpleTargetRunner
{
public:
RemoteLinuxQmlProfilerSupport(ProjectExplorer::RunControl *runControl);
RemoteLinuxQmlToolingSupport(ProjectExplorer::RunControl *runControl,
QmlDebug::QmlDebugServicesPreset services);
private:
void start() override;
ProjectExplorer::PortsGatherer *m_portsGatherer;
ProjectExplorer::RunWorker *m_profiler;
ProjectExplorer::RunWorker *m_runworker;
QmlDebug::QmlDebugServicesPreset m_services;
};
class RemoteLinuxQmlProfilerSupport : public RemoteLinuxQmlToolingSupport
{
public:
RemoteLinuxQmlProfilerSupport(ProjectExplorer::RunControl *runControl) :
RemoteLinuxQmlToolingSupport(runControl, QmlDebug::QmlProfilerServices)
{}
};
} // namespace Internal
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment