From c9f13c0f5c85816b8ce24e06e30cf694ffe49cd3 Mon Sep 17 00:00:00 2001
From: dt <qtc-committer@nokia.com>
Date: Mon, 5 Oct 2009 17:32:32 +0200
Subject: [PATCH] Disable building for projects that advertise that they aren't
 buildable.

And skip building before running for them.
---
 src/plugins/projectexplorer/projectexplorer.cpp | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp
index f1917bf5943..abe34747f45 100644
--- a/src/plugins/projectexplorer/projectexplorer.cpp
+++ b/src/plugins/projectexplorer/projectexplorer.cpp
@@ -1336,7 +1336,9 @@ void ProjectExplorerPlugin::updateActions()
     if (debug)
         qDebug() << "ProjectExplorerPlugin::updateActions";
 
-    bool enableBuildActions = d->m_currentProject && ! (d->m_buildManager->isBuilding(d->m_currentProject));
+    bool enableBuildActions = d->m_currentProject
+                              && ! (d->m_buildManager->isBuilding(d->m_currentProject))
+                              && d->m_currentProject->hasBuildSettings();
     bool hasProjects = !d->m_session->projects().isEmpty();
     bool building = d->m_buildManager->isBuilding();
     QString projectName = d->m_currentProject ? d->m_currentProject->name() : QString();
@@ -1533,7 +1535,7 @@ void ProjectExplorerPlugin::runProjectImpl(Project *pro)
     if (!pro)
         return;
 
-    if (d->m_projectExplorerSettings.buildBeforeRun) {
+    if (d->m_projectExplorerSettings.buildBeforeRun && pro->hasBuildSettings()) {
         if (saveModifiedFiles()) {
             d->m_runMode = ProjectExplorer::Constants::RUNMODE;
             d->m_delayedRunConfiguration = pro->activeRunConfiguration();
@@ -1552,7 +1554,7 @@ void ProjectExplorerPlugin::debugProject()
     if (!pro || d->m_debuggingRunControl )
         return;
 
-    if (d->m_projectExplorerSettings.buildBeforeRun) {
+    if (d->m_projectExplorerSettings.buildBeforeRun && pro->hasBuildSettings()) {
         if (saveModifiedFiles()) {
             d->m_runMode = ProjectExplorer::Constants::DEBUGMODE;
             d->m_delayedRunConfiguration = pro->activeRunConfiguration();
-- 
GitLab