Analyzer: Add prepare step to tool starting.

The toolPreparer can do a last minute check and stop the execution of
the actual tool. The QML profiler uses this to check for unsaved notes.

Change-Id: I5185430f50ffb01e9854cafa442f0eaaad27fa5d
Reviewed-by: hjk <hjk@theqtcompany.com>
This commit is contained in:
Ulf Hermann
2015-06-18 16:26:58 +02:00
committed by hjk
parent 23880f77de
commit bb6e697006
5 changed files with 19 additions and 18 deletions

View File

@@ -70,7 +70,7 @@ bool QmlProfilerPlugin::initialize(const QStringList &arguments, QString *errorS
action->setToolId(QmlProfilerToolId);
action->setWidgetCreator(widgetCreator);
action->setRunControlCreator(runControlCreator);
action->setToolStarter([tool] { tool->startLocalTool(); });
action->setToolPreparer([tool] { return tool->prepareTool(); });
action->setRunMode(ProjectExplorer::QmlProfilerRunMode);
action->setText(tr("QML Profiler"));
action->setToolTip(description);
@@ -83,6 +83,7 @@ bool QmlProfilerPlugin::initialize(const QStringList &arguments, QString *errorS
action->setWidgetCreator(widgetCreator);
action->setRunControlCreator(runControlCreator);
action->setToolStarter([tool] { tool->startRemoteTool(); });
action->setToolPreparer([tool] { return tool->prepareTool(); });
action->setRunMode(ProjectExplorer::QmlProfilerRunMode);
action->setText(tr("QML Profiler (External)"));
action->setToolTip(description);