ProjectExplorer: Store parts of active build config in runcontrol

... on runcontrol creation to prevent later access. Adapt some users.
There are more to come.

Change-Id: I2a3fe5eea0ada4eff7d08b79a6f49694e6962c8a
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
hjk
2019-08-30 12:00:57 +02:00
parent bef986f3fd
commit bcaeb73e68
6 changed files with 32 additions and 13 deletions

View File

@@ -328,6 +328,9 @@ public:
QMap<Core::Id, QVariantMap> settingsData;
Core::Id runConfigId;
BuildTargetInfo buildTargetInfo;
BuildConfiguration::BuildType buildType = BuildConfiguration::Unknown;
FilePath buildDirectory;
Environment buildEnvironment;
Kit *kit = nullptr; // Not owned.
QPointer<Target> target; // Not owned.
QPointer<Project> project; // Not owned.
@@ -376,6 +379,12 @@ void RunControl::setTarget(Target *target)
if (!d->buildKey.isEmpty())
d->buildTargetInfo = target->buildTarget(d->buildKey);
if (auto bc = target->activeBuildConfiguration()) {
d->buildType = bc->buildType();
d->buildDirectory = bc->buildDirectory();
d->buildEnvironment = bc->environment();
}
delete d->outputFormatter;
d->outputFormatter = OutputFormatterFactory::createFormatter(target);
if (!d->outputFormatter)
@@ -907,6 +916,21 @@ QString RunControl::buildKey() const
return d->buildKey;
}
BuildConfiguration::BuildType RunControl::buildType() const
{
return d->buildType;
}
FilePath RunControl::buildDirectory() const
{
return d->buildDirectory;
}
Environment RunControl::buildEnvironment() const
{
return d->buildEnvironment;
}
FilePath RunControl::targetFilePath() const
{
return d->buildTargetInfo.targetFilePath;