aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/projectexplorer/target.cpp
diff options
context:
space:
mode:
authorhjk <hjk@qt.io>2018-04-09 12:33:10 +0200
committerhjk <hjk@qt.io>2018-04-12 12:11:45 +0000
commitbc698d4ce61b95555e1d4ed16cd0d609e7e295e8 (patch)
tree9ecb48aa27ade853f6d1bae246ce1a01ef903b93 /src/plugins/projectexplorer/target.cpp
parent4ab7c19e848701b666a720d85bf5b63fa34a2ce6 (diff)
ProjectExplorer: Consolidate RunConfiguration identifications
The previously per-Project/RunConfiguration changing meanings of BuildTargetInfo::buildTarget have by now been split into separate values in BuildTargetInfo: - buildKey a handle to one item in Target::applicationTargetList - displayName a user-visible string in the run settings page The buildKey was tweaked to coincide with the previous 'extraId', i.e. the non-RunConfiguration-type part of the project configuration id that (still) use id mangling. This allows replacing the cases of locally stored seven different versions of buildKey(-ish) data by one RunConfiguration::m_buildKey, and do all remaining extraId handling in RC::{from,to}Map only, i.e. remove the base ProjectConfiguration::extraId() virtual and remove the "re-try fromMap with mangled id" hack entirely. The id mangling is still used to temporarily maintain .user file compatibility in some cases for now, but should be replaced by storing the build key and the RunConfiguration type soon. Qbs already changes in here to only use the uniqueProductName as buildKey, without the previously added display name which is stored as part of the ProjectConfiguration already. It turns out that RunConfiguration::buildSystemTarget was intended and used to retrieve an item from the Target::applicationTargetList for some configurations, coinciding with what buildKey does always. So use that insteand and drop RunConfiguration::buildSystemTarget. There is clearly is further consolidation potential left. handling of (default)displayNames is still a per-runconfiguration mess and there is further consolidation potential left. Change-Id: I448ed30f1b562fb91b970e328a42fa5f6fb2e43e Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Diffstat (limited to 'src/plugins/projectexplorer/target.cpp')
-rw-r--r--src/plugins/projectexplorer/target.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/plugins/projectexplorer/target.cpp b/src/plugins/projectexplorer/target.cpp
index 1dd9561649..de47a67f26 100644
--- a/src/plugins/projectexplorer/target.cpp
+++ b/src/plugins/projectexplorer/target.cpp
@@ -564,8 +564,8 @@ void Target::updateDefaultRunConfigurations()
foreach (RunConfiguration *rc, existingConfigured) {
bool present = false;
for (const RunConfigurationCreationInfo &item : creators) {
- QString rcExtraId = rc->extraId();
- if (item.id == rc->id() && (item.targetName == rcExtraId || item.buildKey == rcExtraId)) {
+ QString buildKey = rc->buildKey();
+ if (item.id == rc->id() && item.buildKey == buildKey) {
existing.append(item);
present = true;
}
@@ -581,7 +581,7 @@ void Target::updateDefaultRunConfigurations()
continue;
bool exists = false;
for (const RunConfigurationCreationInfo &ex : existing) {
- if (ex.id == item.id && ex.targetName == item.targetName)
+ if (ex.id == item.id && ex.buildKey == item.buildKey)
exists = true;
}
if (exists)
@@ -776,7 +776,7 @@ bool Target::fromMap(const QVariantMap &map)
id.isValid() ? qPrintable(id.toString()) : "UNKNOWN");
continue;
}
- QTC_CHECK(dc->id().withSuffix(dc->extraId()) == ProjectExplorer::idFromMap(valueMap));
+ QTC_CHECK(dc->id() == ProjectExplorer::idFromMap(valueMap));
addDeployConfiguration(dc);
if (i == activeConfiguration)
setActiveDeployConfiguration(dc);
@@ -801,7 +801,7 @@ bool Target::fromMap(const QVariantMap &map)
RunConfiguration *rc = RunConfigurationFactory::restore(this, valueMap);
if (!rc)
continue;
- QTC_CHECK(rc->id().withSuffix(rc->extraId()) == ProjectExplorer::idFromMap(valueMap));
+ QTC_CHECK(rc->id().withSuffix(rc->buildKey()) == ProjectExplorer::idFromMap(valueMap));
addRunConfiguration(rc);
if (i == activeConfiguration)
setActiveRunConfiguration(rc);