forked from qt-creator/qt-creator
Analyzer: Slim down AnalyzerStartParameters
* SysRoot can always be determined from kit. * Pass around RunMode as extra parameter not as part of AnalyzerStartParameters. That's closer to the pattern used elsewhere. * Environment was always initialized from the runconfig's EnvironmentAspect. The tools can do that directly. * Provide setter for display name for cases where it is not equal to RunConfiguration::displayName Change-Id: I811a0d7cdeb55cc37a16a593b3942abb567a2150 Reviewed-by: BogDan Vatra <bogdan@kdab.com> Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
This commit is contained in:
@@ -197,6 +197,15 @@ QmlProfilerTool::~QmlProfilerTool()
|
||||
delete d;
|
||||
}
|
||||
|
||||
static QString sysroot(RunConfiguration *runConfig)
|
||||
{
|
||||
QTC_ASSERT(runConfig, return QString());
|
||||
Kit *k = runConfig->target()->kit();
|
||||
if (k && SysRootKitInformation::hasSysRoot(k))
|
||||
return SysRootKitInformation::sysRoot(runConfig->target()->kit()).toString();
|
||||
return QString();
|
||||
}
|
||||
|
||||
AnalyzerRunControl *QmlProfilerTool::createRunControl(const AnalyzerStartParameters &sp,
|
||||
RunConfiguration *runConfiguration)
|
||||
{
|
||||
@@ -231,7 +240,7 @@ AnalyzerRunControl *QmlProfilerTool::createRunControl(const AnalyzerStartParamet
|
||||
projectDirectory = project->projectDirectory().toString();
|
||||
}
|
||||
|
||||
populateFileFinder(projectDirectory, sp.sysroot);
|
||||
populateFileFinder(projectDirectory, sysroot(runConfiguration));
|
||||
|
||||
if (sp.analyzerSocket.isEmpty())
|
||||
connect(engine, &QmlProfilerRunControl::processRunning,
|
||||
@@ -242,15 +251,6 @@ AnalyzerRunControl *QmlProfilerTool::createRunControl(const AnalyzerStartParamet
|
||||
return engine;
|
||||
}
|
||||
|
||||
static QString sysroot(RunConfiguration *runConfig)
|
||||
{
|
||||
QTC_ASSERT(runConfig, return QString());
|
||||
Kit *k = runConfig->target()->kit();
|
||||
if (k && SysRootKitInformation::hasSysRoot(k))
|
||||
return SysRootKitInformation::sysRoot(runConfig->target()->kit()).toString();
|
||||
return QString();
|
||||
}
|
||||
|
||||
QWidget *QmlProfilerTool::createWidgets()
|
||||
{
|
||||
QTC_ASSERT(!d->m_viewContainer, return 0);
|
||||
@@ -526,7 +526,6 @@ void QmlProfilerTool::startRemoteTool()
|
||||
sp.connParams = device->sshParameters();
|
||||
sp.analyzerHost = device->qmlProfilerHost();
|
||||
}
|
||||
sp.sysroot = SysRootKitInformation::sysRoot(kit).toString();
|
||||
sp.analyzerPort = port;
|
||||
|
||||
AnalyzerRunControl *rc = createRunControl(sp, 0);
|
||||
|
||||
Reference in New Issue
Block a user