ProjectExplorer: Less use of stored RunConfiguration in RunControl

Change-Id: I501433dcbc3d40c6439f5ab003e06f5a72b9d83e
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
hjk
2019-08-26 17:02:22 +02:00
parent 69b4e2a118
commit 19580ab203

View File

@@ -324,6 +324,7 @@ public:
Utils::Icon icon; Utils::Icon icon;
MacroExpander *macroExpander; MacroExpander *macroExpander;
QPointer<RunConfiguration> runConfiguration; // Not owned. Avoid use. QPointer<RunConfiguration> runConfiguration; // Not owned. Avoid use.
QString buildKey;
Core::Id runConfigId; Core::Id runConfigId;
Kit *kit = nullptr; // Not owned. Kit *kit = nullptr; // Not owned.
QPointer<Target> target; // Not owned. QPointer<Target> target; // Not owned.
@@ -358,6 +359,7 @@ void RunControl::setRunConfiguration(RunConfiguration *runConfig)
d->runnable = runConfig->runnable(); d->runnable = runConfig->runnable();
d->displayName = runConfig->displayName(); d->displayName = runConfig->displayName();
d->macroExpander = runConfig->macroExpander(); d->macroExpander = runConfig->macroExpander();
d->buildKey = runConfig->buildKey();
setTarget(runConfig->target()); setTarget(runConfig->target());
} }
@@ -895,17 +897,17 @@ ISettingsAspect *RunControl::settings(Core::Id id) const
QString RunControl::buildKey() const QString RunControl::buildKey() const
{ {
return d->runConfiguration ? d->runConfiguration->buildKey() : QString(); return d->buildKey;
} }
FilePath RunControl::targetFilePath() const FilePath RunControl::targetFilePath() const
{ {
return d->runConfiguration->buildTargetInfo().targetFilePath; return d->target->buildTarget(d->buildKey).targetFilePath;
} }
FilePath RunControl::projectFilePath() const FilePath RunControl::projectFilePath() const
{ {
return d->runConfiguration->buildTargetInfo().projectFilePath; return d->target->buildTarget(d->buildKey).projectFilePath;
} }
/*! /*!