summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhjk <hjk@qt.io>2018-04-26 18:00:17 +0200
committerhjk <hjk@qt.io>2018-05-03 05:58:47 +0000
commitadaf1b3826391945cb52e693c80e564b7a93a6ac (patch)
tree48eae1f03d3aabb05f64e2be51c56f75aa83087b
parenteca2f5da53719a873072d1312040aaf984ad1d91 (diff)
downloadqt-creator-adaf1b3826391945cb52e693c80e564b7a93a6ac.tar.gz
WinRt: Generalize executable extraction in WinRtRunnerHelper
This was the only remaining user of ProjectExplorer:: BuildTargetInfoLists::targetForProject was only. The result after direct inlining shows that it relies on the qmake-centered assumption that the the .pro file name is used as build key in BuildTargetInfoLists, so replace it with the now-generic projectFilePath member instead. Change-Id: Ic4dccfb347289a3dcbb4c6a11b71cf568b054fd8 Reviewed-by: David Schulz <david.schulz@qt.io>
-rw-r--r--src/plugins/projectexplorer/buildtargetinfo.h14
-rw-r--r--src/plugins/winrt/winrtrunnerhelper.cpp9
2 files changed, 6 insertions, 17 deletions
diff --git a/src/plugins/projectexplorer/buildtargetinfo.h b/src/plugins/projectexplorer/buildtargetinfo.h
index f0f4e4f291..1da61b7d0f 100644
--- a/src/plugins/projectexplorer/buildtargetinfo.h
+++ b/src/plugins/projectexplorer/buildtargetinfo.h
@@ -72,20 +72,6 @@ inline uint qHash(const BuildTargetInfo &ti)
class PROJECTEXPLORER_EXPORT BuildTargetInfoList
{
public:
- Utils::FileName targetForProject(const QString &projectFilePath) const
- {
- return targetForProject(Utils::FileName::fromString(projectFilePath));
- }
-
- Utils::FileName targetForProject(const Utils::FileName &projectFilePath) const
- {
- foreach (const BuildTargetInfo &ti, list) {
- if (ti.projectFilePath == projectFilePath)
- return ti.targetFilePath;
- }
- return Utils::FileName();
- }
-
BuildTargetInfo buildTargetInfo(const QString &buildKey) {
return Utils::findOrDefault(list, [&buildKey](const BuildTargetInfo &ti) {
return ti.buildKey == buildKey;
diff --git a/src/plugins/winrt/winrtrunnerhelper.cpp b/src/plugins/winrt/winrtrunnerhelper.cpp
index 3b23a875f0..0c6abf6be2 100644
--- a/src/plugins/winrt/winrtrunnerhelper.cpp
+++ b/src/plugins/winrt/winrtrunnerhelper.cpp
@@ -41,6 +41,8 @@
#include <QDir>
+using namespace ProjectExplorer;
+
using namespace WinRt;
using namespace WinRt::Internal;
@@ -66,11 +68,12 @@ WinRtRunnerHelper::WinRtRunnerHelper(ProjectExplorer::RunWorker *runWorker, QStr
return;
}
- const QString &proFile = runConfiguration->proFilePath();
- m_executableFilePath = target->applicationTargets().targetForProject(proFile).toString();
+ const BuildTargetInfo bti = target->applicationTargets().buildTargetInfo(runConfiguration->buildKey());
+ m_executableFilePath = bti.targetFilePath.toString();
+
if (m_executableFilePath.isEmpty()) {
*errorMessage = tr("Cannot determine the executable file path for \"%1\".").arg(
- QDir::toNativeSeparators(proFile));
+ QDir::toNativeSeparators(bti.projectFilePath.toString()));
return;
}