Commit a527fbe9 authored by hjk's avatar hjk

IDevice: Add a qmlProfilerHost function

This seems to be a better abstraction than the "pseudo dynamic cast"
in the QmlProfilerTool and the DebuggerPlugin itself.

Change-Id: If7dea70e1353852ebb6d3ce43220c0b03ccb4b00
Reviewed-by: default avatarChristian Kandeler <christian.kandeler@digia.com>
parent 8f28a37d
......@@ -99,5 +99,10 @@ IDevice::Ptr AndroidDevice::clone() const
return IDevice::Ptr(new AndroidDevice(*this));
}
QString AndroidDevice::qmlProfilerHost() const
{
return QLatin1String("localhost");
}
} // namespace Internal
} // namespace Android
......@@ -50,6 +50,7 @@ public:
ProjectExplorer::DeviceProcessSignalOperation::Ptr signalOperation() const;
ProjectExplorer::IDevice::Ptr clone() const;
QString qmlProfilerHost() const;
protected:
friend class AndroidDeviceFactory;
......
......@@ -94,8 +94,6 @@
#include <projectexplorer/session.h>
#include <projectexplorer/target.h>
#include <android/androidconstants.h>
#include <texteditor/basetexteditor.h>
#include <texteditor/fontsettings.h>
#include <texteditor/texteditorsettings.h>
......@@ -1752,12 +1750,7 @@ void DebuggerPluginPrivate::attachToQmlPort()
IDevice::ConstPtr device = DeviceKitInformation::device(kit);
if (device) {
sp.connParams = device->sshParameters();
if (device->type() == ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE
|| device->type() == Android::Constants::ANDROID_DEVICE_TYPE) {
sp.qmlServerAddress = QLatin1String("localhost");
} else {
sp.qmlServerAddress = sp.connParams.host;
}
sp.qmlServerAddress = device->qmlProfilerHost();
}
sp.qmlServerPort = dlg.port();
sp.startMode = AttachToRemoteProcess;
......
......@@ -120,6 +120,11 @@ DeviceProcessSignalOperation::Ptr DesktopDevice::signalOperation() const
return DeviceProcessSignalOperation::Ptr(new DesktopProcessSignalOperation());
}
QString DesktopDevice::qmlProfilerHost() const
{
return QLatin1String("localhost");
}
IDevice::Ptr DesktopDevice::clone() const
{
return Ptr(new DesktopDevice(*this));
......
......@@ -56,6 +56,7 @@ public:
bool canCreateProcess() const { return true; }
DeviceProcess *createProcess(QObject *parent) const;
DeviceProcessSignalOperation::Ptr signalOperation() const;
QString qmlProfilerHost() const;
IDevice::Ptr clone() const;
......
......@@ -380,6 +380,11 @@ void IDevice::setSshParameters(const QSsh::SshConnectionParameters &sshParameter
d->sshParameters = sshParameters;
}
QString IDevice::qmlProfilerHost() const
{
return d->sshParameters.host;
}
void IDevice::setFreePorts(const Utils::PortList &freePorts)
{
d->freePorts = freePorts;
......
......@@ -159,6 +159,8 @@ public:
QSsh::SshConnectionParameters sshParameters() const;
void setSshParameters(const QSsh::SshConnectionParameters &sshParameters);
virtual QString qmlProfilerHost() const;
Utils::PortList freePorts() const;
void setFreePorts(const Utils::PortList &freePorts);
......
......@@ -57,8 +57,6 @@
#include <projectexplorer/localapplicationrunconfiguration.h>
#include <texteditor/itexteditor.h>
#include <android/androidconstants.h>
#include <coreplugin/coreconstants.h>
#include <coreplugin/editormanager/editormanager.h>
#include <coreplugin/icore.h>
......@@ -431,12 +429,7 @@ static void startRemoteTool(IAnalyzerTool *tool, StartMode mode)
IDevice::ConstPtr device = DeviceKitInformation::device(kit);
if (device) {
sp.connParams = device->sshParameters();
if (device->type() == ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE
|| device->type() == Android::Constants::ANDROID_DEVICE_TYPE) {
sp.analyzerHost = QLatin1String("localhost");
} else {
sp.analyzerHost = sp.connParams.host;
}
sp.analyzerHost = device->qmlProfilerHost();
}
sp.sysroot = SysRootKitInformation::sysRoot(kit).toString();
sp.analyzerPort = port;
......
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