From bf10b04f7ffbd2cbcc7d787307aa284667c4936b Mon Sep 17 00:00:00 2001
From: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Date: Tue, 19 Jan 2010 15:59:36 +0100
Subject: [PATCH] don't guess .pro file names for SUBDIRS targets

qmake doesn't, either
---
 src/plugins/qt4projectmanager/qt4nodes.cpp | 21 +++++++--------------
 1 file changed, 7 insertions(+), 14 deletions(-)

diff --git a/src/plugins/qt4projectmanager/qt4nodes.cpp b/src/plugins/qt4projectmanager/qt4nodes.cpp
index d8715d55e73..ef158839f79 100644
--- a/src/plugins/qt4projectmanager/qt4nodes.cpp
+++ b/src/plugins/qt4projectmanager/qt4nodes.cpp
@@ -1154,24 +1154,17 @@ QStringList Qt4ProFileNode::subDirsPaths(ProFileReader *reader) const
         QString realFile;
         if (info.isDir()) {
             realFile = QString("%1/%2.pro").arg(realDir, info.fileName());
-            if (!QFile::exists(realFile)) {
-                // parse directory for pro files - if there is only one, use that
-                QDir dir(realDir);
-                QStringList files = dir.entryList(QStringList() << "*.pro", QDir::Files);
-                if (files.size() == 1) {
-                    realFile = QString("%1/%2").arg(realDir, files.first());
-                } else {
-                    m_project->proFileParseError(tr("Could not find .pro file for sub dir '%1' in '%2'")
-                            .arg(subDirVar).arg(realDir));
-                    realFile = QString::null;
-                }
-            }
         } else {
             realFile = realDir;
         }
 
-        if (!realFile.isEmpty() && !subProjectPaths.contains(realFile))
-            subProjectPaths << realFile;
+        if (QFile::exists(realFile)) {
+            if (!subProjectPaths.contains(realFile))
+                subProjectPaths << realFile;
+        } else {
+            m_project->proFileParseError(tr("Could not find .pro file for sub dir '%1' in '%2'")
+                                         .arg(subDirVar).arg(realDir));
+        }
     }
 
     return subProjectPaths;
-- 
GitLab