forked from qt-creator/qt-creator
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:
@@ -214,6 +214,8 @@ bool RunConfiguration::isActive() const
|
||||
|
||||
QString RunConfiguration::disabledReason() const
|
||||
{
|
||||
if (!target()->hasBuildTarget(m_buildKey))
|
||||
return tr("The project no longer builds the target associated with this run configuration.");
|
||||
if (target()->project()->isParsing())
|
||||
return tr("The Project is currently being parsed.");
|
||||
if (!target()->project()->hasParsingData())
|
||||
@@ -243,9 +245,14 @@ QWidget *RunConfiguration::createConfigurationWidget()
|
||||
|
||||
void RunConfiguration::updateEnabledState()
|
||||
{
|
||||
Project *p = target()->project();
|
||||
|
||||
setEnabled(!p->isParsing() && p->hasParsingData());
|
||||
if (!target()->hasBuildTarget(m_buildKey)) {
|
||||
// This apparently may happen for cmake builds where also outdated
|
||||
// RunConfigurations are kept when builds change.
|
||||
setEnabled(false); // Might happen for CMake.
|
||||
} else {
|
||||
Project *p = target()->project();
|
||||
setEnabled(!p->isParsing() && p->hasParsingData());
|
||||
}
|
||||
}
|
||||
|
||||
void RunConfiguration::addAspectFactory(const AspectFactory &aspectFactory)
|
||||
|
||||
Reference in New Issue
Block a user