forked from qt-creator/qt-creator
QmlProfiling: Attach to QML application
Redo the Attach dialog to use Kits. This is in sync with the Valgrind Attach dialog. Change-Id: Iaf0c8bc2c5a912b6a93ed21b9757a074a60041c0 Reviewed-by: Christiaan Janssen <christiaan.janssen@digia.com>
This commit is contained in:
@@ -60,6 +60,8 @@
|
||||
#include <remotelinux/remotelinuxrunconfiguration.h>
|
||||
#include <remotelinux/linuxdevice.h>
|
||||
|
||||
#include <android/androidconstants.h>
|
||||
|
||||
#include <coreplugin/coreconstants.h>
|
||||
#include <coreplugin/editormanager/editormanager.h>
|
||||
#include <coreplugin/icore.h>
|
||||
@@ -519,42 +521,46 @@ static void startRemoteTool(IAnalyzerTool *tool, StartMode mode)
|
||||
{
|
||||
Q_UNUSED(tool);
|
||||
|
||||
QString host;
|
||||
Id kitId;
|
||||
quint16 port;
|
||||
QString sysroot;
|
||||
Kit *kit = 0;
|
||||
|
||||
{
|
||||
QSettings *settings = ICore::settings();
|
||||
|
||||
host = settings->value(QLatin1String("AnalyzerQmlAttachDialog/host"), QLatin1String("localhost")).toString();
|
||||
port = settings->value(QLatin1String("AnalyzerQmlAttachDialog/port"), 3768).toInt();
|
||||
sysroot = settings->value(QLatin1String("AnalyzerQmlAttachDialog/sysroot")).toString();
|
||||
kitId = Id::fromSetting(settings->value(QLatin1String("AnalyzerQmlAttachDialog/kitId")));
|
||||
port = settings->value(QLatin1String("AnalyzerQmlAttachDialog/port"), 3768).toUInt();
|
||||
|
||||
QmlProfilerAttachDialog dialog;
|
||||
|
||||
dialog.setAddress(host);
|
||||
dialog.setKitId(kitId);
|
||||
dialog.setPort(port);
|
||||
dialog.setSysroot(sysroot);
|
||||
|
||||
if (dialog.exec() != QDialog::Accepted)
|
||||
return;
|
||||
|
||||
host = dialog.address();
|
||||
kit = dialog.kit();
|
||||
port = dialog.port();
|
||||
sysroot = dialog.sysroot();
|
||||
|
||||
settings->setValue(QLatin1String("AnalyzerQmlAttachDialog/host"), host);
|
||||
settings->setValue(QLatin1String("AnalyzerQmlAttachDialog/kitId"), kit->id().toSetting());
|
||||
settings->setValue(QLatin1String("AnalyzerQmlAttachDialog/port"), port);
|
||||
settings->setValue(QLatin1String("AnalyzerQmlAttachDialog/sysroot"), sysroot);
|
||||
}
|
||||
|
||||
AnalyzerStartParameters sp;
|
||||
sp.toolId = tool->id();
|
||||
sp.startMode = mode;
|
||||
sp.connParams.host = host;
|
||||
sp.connParams.port = port;
|
||||
sp.sysroot = sysroot;
|
||||
sp.analyzerHost = host;
|
||||
|
||||
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.sysroot = SysRootKitInformation::sysRoot(kit).toString();
|
||||
sp.analyzerPort = port;
|
||||
|
||||
AnalyzerRunControl *rc = new AnalyzerRunControl(tool, sp, 0);
|
||||
|
Reference in New Issue
Block a user