From fad03acbd0e2be1549e94f6dc289c3500626cc79 Mon Sep 17 00:00:00 2001 From: dt_ Date: Mon, 30 May 2011 17:58:04 +0200 Subject: [PATCH] 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 Reviewed-by: Christian Kandeler --- src/plugins/projectexplorer/projectexplorer.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index ffd28e49d2..f7ba0b058e 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -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."); -- 2.11.0