forked from qt-creator/qt-creator
GenericProjectManager: Do not make every subdir an include dir
Large projects can have thousands of subdirectories, only a tiny subset of which are supposed to be include directories. Use the directory name as a heuristic instead. Fixes: QTCREATORBUG-29099 Change-Id: I207ea2b7d2739c4f6c27fa96865dfde2570caf8a Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -330,8 +330,9 @@ bool GenericBuildSystem::addFiles(Node *, const FilePaths &filePaths_, FilePaths
|
||||
QSet<QString> toAdd;
|
||||
|
||||
for (const QString &filePath : filePaths) {
|
||||
const QString directory = QFileInfo(filePath).absolutePath();
|
||||
if (!includes.contains(directory))
|
||||
const QFileInfo fi(filePath);
|
||||
const QString directory = fi.absolutePath();
|
||||
if (fi.fileName() == "include" && !includes.contains(directory))
|
||||
toAdd << directory;
|
||||
}
|
||||
|
||||
|
||||
@@ -141,6 +141,8 @@ Core::GeneratedFiles GenericProjectWizard::generateFiles(const QWizard *w,
|
||||
const QDir dir(projectPath.toString());
|
||||
for (const QString &path : paths) {
|
||||
QFileInfo fileInfo(path);
|
||||
if (fileInfo.fileName() != "include")
|
||||
continue;
|
||||
QDir thisDir(fileInfo.absoluteFilePath());
|
||||
|
||||
if (! thisDir.entryList(nameFilters, QDir::Files).isEmpty()) {
|
||||
|
||||
Reference in New Issue
Block a user