diff options
author | hjk <hjk@theqtcompany.com> | 2016-01-06 11:40:52 +0100 |
---|---|---|
committer | hjk <hjk@theqtcompany.com> | 2016-01-07 18:11:09 +0000 |
commit | 8150209ff7b9a4bb5bf8e580ac05c9dc2fe77854 (patch) | |
tree | addda607567ebff49c36e70ef431f3f512d8e47a /src/plugins/qmlprofiler/qmlprofilertool.cpp | |
parent | 312069209220083fcf83a749c8cfcb7db80dad8f (diff) | |
download | qt-creator-8150209ff7b9a4bb5bf8e580ac05c9dc2fe77854.tar.gz |
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>
Diffstat (limited to 'src/plugins/qmlprofiler/qmlprofilertool.cpp')
-rw-r--r-- | src/plugins/qmlprofiler/qmlprofilertool.cpp | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/src/plugins/qmlprofiler/qmlprofilertool.cpp b/src/plugins/qmlprofiler/qmlprofilertool.cpp index 617f3248af..bcc46aed16 100644 --- a/src/plugins/qmlprofiler/qmlprofilertool.cpp +++ b/src/plugins/qmlprofiler/qmlprofilertool.cpp @@ -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); |