forked from qt-creator/qt-creator
Add runConfiguration to remote tool starters
Most of them need a run configuration. It's better to pass the right one than to use various hacky ways to work around it. Change-Id: Ic21b0ef33bdd79b526b1e1a1ead5ca87d9f32c4d Reviewed-by: hjk <hjk@theqtcompany.com>
This commit is contained in:
@@ -81,7 +81,9 @@ bool QmlProfilerPlugin::initialize(const QStringList &arguments, QString *errorS
|
||||
action->setToolId(Constants::QmlProfilerToolId);
|
||||
action->setWidgetCreator(widgetCreator);
|
||||
action->setRunControlCreator(runControlCreator);
|
||||
action->setCustomToolStarter([tool] { tool->startRemoteTool(); });
|
||||
action->setCustomToolStarter([tool](ProjectExplorer::RunConfiguration *rc) {
|
||||
tool->startRemoteTool(rc);
|
||||
});
|
||||
action->setToolPreparer([tool] { return tool->prepareTool(); });
|
||||
action->setRunMode(ProjectExplorer::Constants::QML_PROFILER_RUN_MODE);
|
||||
action->setText(tr("QML Profiler (External)"));
|
||||
|
||||
@@ -487,7 +487,7 @@ bool QmlProfilerTool::prepareTool()
|
||||
return true;
|
||||
}
|
||||
|
||||
void QmlProfilerTool::startRemoteTool()
|
||||
void QmlProfilerTool::startRemoteTool(ProjectExplorer::RunConfiguration *rc)
|
||||
{
|
||||
AnalyzerManager::showMode();
|
||||
|
||||
@@ -525,7 +525,7 @@ void QmlProfilerTool::startRemoteTool()
|
||||
}
|
||||
connection.analyzerPort = port;
|
||||
|
||||
auto runControl = qobject_cast<QmlProfilerRunControl *>(createRunControl(0));
|
||||
auto runControl = qobject_cast<QmlProfilerRunControl *>(createRunControl(rc));
|
||||
runControl->setConnection(connection);
|
||||
|
||||
ProjectExplorerPlugin::startRunControl(runControl, ProjectExplorer::Constants::QML_PROFILER_RUN_MODE);
|
||||
|
||||
@@ -56,7 +56,7 @@ public:
|
||||
|
||||
QWidget *createWidgets();
|
||||
bool prepareTool();
|
||||
void startRemoteTool();
|
||||
void startRemoteTool(ProjectExplorer::RunConfiguration *rc);
|
||||
|
||||
static QList <QAction *> profilerContextMenuActions();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user