ProjectExplorer: Upstream CMake's handling of outdated builds

This is mainly there to make the local runconfiguration implementations
more uniform. Both qmake and qbs will drop runconfigs for builds that
are not available anymore, so that's a no-op for them.

Change-Id: I8aa32d779f67cce7a4d4733cfbe0c9a136bfd3f7
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
hjk
2019-02-22 12:16:56 +01:00
parent 4a1a008bab
commit 8536504caa
5 changed files with 18 additions and 30 deletions

View File

@@ -73,28 +73,6 @@ void CMakeRunConfiguration::doAdditionalSetup(const RunConfigurationCreationInfo
updateTargetInformation();
}
bool CMakeRunConfiguration::isBuildTargetValid() const
{
return Utils::anyOf(target()->applicationTargets().list, [this](const BuildTargetInfo &bti) {
return bti.buildKey == buildKey();
});
}
void CMakeRunConfiguration::updateEnabledState()
{
if (!isBuildTargetValid())
setEnabled(false);
else
RunConfiguration::updateEnabledState();
}
QString CMakeRunConfiguration::disabledReason() const
{
if (!isBuildTargetValid())
return tr("The project no longer builds the target associated with this run configuration.");
return RunConfiguration::disabledReason();
}
void CMakeRunConfiguration::updateTargetInformation()
{
BuildTargetInfo bti = buildTargetInfo();