ProjectExplorer: Introduce a central mechanism to update RC aspects

Using the usual pattern of setting a std::function, and calling it.

In the initial steps, update() is meant to be manually called in the
derived RunConfigurations, mid-term the idea is to at least cover
well-known ("Kit changed", ...) cases centrally.

Change-Id: Ic00572bb57fb45ef109bd0ddb8a9c3132d4f0f13
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
hjk
2019-11-25 11:10:11 +01:00
parent 6c66af5c23
commit 480fb3f66d
2 changed files with 17 additions and 0 deletions

View File

@@ -311,6 +311,11 @@ BuildSystem *RunConfiguration::activeBuildSystem() const
return target()->buildSystem();
}
void RunConfiguration::setUpdater(const Updater &updater)
{
m_updater = updater;
}
QVariantMap RunConfiguration::toMap() const
{
QVariantMap map = ProjectConfiguration::toMap();
@@ -336,6 +341,12 @@ CommandLine RunConfiguration::commandLine() const
return m_commandLineGetter();
}
void RunConfiguration::update()
{
QTC_ASSERT(m_updater, return);
m_updater();
}
BuildTargetInfo RunConfiguration::buildTargetInfo() const
{
BuildSystem *bs = target()->buildSystem();