Better disabled reason for runconfigurations

Check isEnabled() before the runcontrol factory

Change-Id: Ied7e0a9c951adf5ce10f50f901af6bf24f1e3c21
Reviewed-on: http://codereview.qt.nokia.com/249
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Christian Kandeler <christian.kandeler@nokia.com>
This commit is contained in:
dt_
2011-05-30 17:58:04 +02:00
committed by Daniel Teske
parent 8b2cebd703
commit fad03acbd0

View File

@@ -2156,13 +2156,14 @@ QString ProjectExplorerPlugin::cannotRunReason(Project *project, const QString &
RunConfiguration *activeRC = project->activeTarget()->activeRunConfiguration();
if (!activeRC->isEnabled())
return activeRC->disabledReason();
// shouldn't actually be shown to the user...
if (!findRunControlFactory(activeRC, runMode))
return tr("Cannot run '%1' in mode '%2'.")
.arg(activeRC->displayName(), runMode);
if (!activeRC->isEnabled())
return activeRC->disabledReason();
if (d->m_buildManager->isBuilding())
return tr("A build is still in progress.");