diff --git a/src/plugins/classview/classviewparser.cpp b/src/plugins/classview/classviewparser.cpp
index 93b9f9ed7b054333f33e1161d59d859faffafe17..838a59e15cb94c20216f9abd4f6716cb6de36cf0 100644
--- a/src/plugins/classview/classviewparser.cpp
+++ b/src/plugins/classview/classviewparser.cpp
@@ -651,7 +651,7 @@ void Parser::resetData(const CPlusPlus::Snapshot &snapshot)
     // check all projects
     foreach (const Project *prj, SessionManager::projects()) {
         if (prj)
-            fileList += prj->files(Project::ExcludeGeneratedFiles);
+            fileList += prj->files(Project::SourceFiles);
     }
     setFileList(fileList);
 
diff --git a/src/plugins/clearcase/clearcaseplugin.cpp b/src/plugins/clearcase/clearcaseplugin.cpp
index 192262d17eacf65488e59f4a43ec1c7c2e064e88..17d8ccb1bac4a7f53075aa4208ab095d30892e11 100644
--- a/src/plugins/clearcase/clearcaseplugin.cpp
+++ b/src/plugins/clearcase/clearcaseplugin.cpp
@@ -2078,8 +2078,7 @@ void ClearCasePlugin::updateIndex()
         return;
     m_checkInAllAction->setEnabled(false);
     m_statusMap->clear();
-    QFuture<void> result = QtConcurrent::run(&sync,
-               project->files(Project::ExcludeGeneratedFiles));
+    QFuture<void> result = QtConcurrent::run(&sync, project->files(Project::SourceFiles));
     if (!m_settings.disableIndexer)
         ProgressManager::addTask(result, tr("Updating ClearCase Index"), ClearCase::Constants::TASK_INDEX);
 }
diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp
index 539a83fe83779ac3222747e6c96ac73e747b989b..4461dfde512f1fcd9fd53749581e52ef2e8ebe60 100644
--- a/src/plugins/debugger/debuggerplugin.cpp
+++ b/src/plugins/debugger/debuggerplugin.cpp
@@ -1539,7 +1539,7 @@ void DebuggerPluginPrivate::attachToQmlPort()
     }
     QStringList sourceFiles;
     foreach (Project *project, projects)
-        sourceFiles << project->files(Project::ExcludeGeneratedFiles);
+        sourceFiles << project->files(Project::SourceFiles);
 
     rp.projectSourceDirectory =
             !projects.isEmpty() ? projects.first()->projectDirectory().toString() : QString();
diff --git a/src/plugins/debugger/debuggerruncontrol.cpp b/src/plugins/debugger/debuggerruncontrol.cpp
index 6f0c74bcb506af5ef1e7be1f9d1c316ad8c57da4..c93d2667a55f199a9f0a8816506f9e973696dace 100644
--- a/src/plugins/debugger/debuggerruncontrol.cpp
+++ b/src/plugins/debugger/debuggerruncontrol.cpp
@@ -421,10 +421,10 @@ void DebuggerRunControlCreator::enrich(const RunConfiguration *runConfig, const
         m_rp.projectSourceDirectory = m_project->projectDirectory().toString();
 
     if (m_project && m_rp.projectSourceFiles.isEmpty())
-        m_rp.projectSourceFiles = m_project->files(Project::ExcludeGeneratedFiles);
+        m_rp.projectSourceFiles = m_project->files(Project::SourceFiles);
 
     if (m_project && m_rp.projectSourceFiles.isEmpty())
-        m_rp.projectSourceFiles = m_project->files(Project::ExcludeGeneratedFiles);
+        m_rp.projectSourceFiles = m_project->files(Project::SourceFiles);
 
     if (false && m_project && m_kit) {
         const QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(m_kit);
@@ -453,7 +453,7 @@ void DebuggerRunControlCreator::enrich(const RunConfiguration *runConfig, const
 
     if (m_project) {
         m_rp.projectSourceDirectory = m_project->projectDirectory().toString();
-        m_rp.projectSourceFiles = m_project->files(Project::ExcludeGeneratedFiles);
+        m_rp.projectSourceFiles = m_project->files(Project::SourceFiles);
     }
 
     if (m_runConfig)
diff --git a/src/plugins/modeleditor/modelindexer.cpp b/src/plugins/modeleditor/modelindexer.cpp
index 2dd95ad313a1c233f5bb6a254ff86a707fe68501..23735a7940557136bcad1737ba556d0c3f4d9013 100644
--- a/src/plugins/modeleditor/modelindexer.cpp
+++ b/src/plugins/modeleditor/modelindexer.cpp
@@ -388,7 +388,7 @@ void ModelIndexer::onProjectFileListChanged(ProjectExplorer::Project *project)
 void ModelIndexer::scanProject(ProjectExplorer::Project *project)
 {
     // TODO harmonize following code with findFirstModel()?
-    QStringList files = project->files(ProjectExplorer::Project::ExcludeGeneratedFiles);
+    QStringList files = project->files(ProjectExplorer::Project::SourceFiles);
     QQueue<QueuedFile> filesQueue;
     QSet<QueuedFile> filesSet;
 
@@ -471,7 +471,7 @@ QString ModelIndexer::findFirstModel(ProjectExplorer::FolderNode *folderNode)
 
 void ModelIndexer::forgetProject(ProjectExplorer::Project *project)
 {
-    QStringList files = project->files(ProjectExplorer::Project::ExcludeGeneratedFiles);
+    QStringList files = project->files(ProjectExplorer::Project::SourceFiles);
 
     QMutexLocker locker(&d->indexerMutex);
     foreach (const QString &file, files) {
diff --git a/src/plugins/projectexplorer/project.h b/src/plugins/projectexplorer/project.h
index 92c440c5bc22a91948ac518df9f2916e5281e86b..7ac911146846e75bf379955905f45ac2385dd30d 100644
--- a/src/plugins/projectexplorer/project.h
+++ b/src/plugins/projectexplorer/project.h
@@ -114,7 +114,11 @@ public:
     enum class RestoreResult { Ok, Error, UserAbort };
     RestoreResult restoreSettings(QString *errorMessage);
 
-    enum FilesMode { AllFiles, ExcludeGeneratedFiles };
+    enum FilesMode {
+        SourceFiles    = 0x1,
+        GeneratedFiles = 0x2,
+        AllFiles       = SourceFiles | GeneratedFiles
+    };
     virtual QStringList files(FilesMode fileMode) const = 0;
     // TODO: generalize to find source(s) of generated files?
     virtual QString generatedUiHeader(const Utils::FileName &formFile) const;
diff --git a/src/plugins/qmakeprojectmanager/qmakeproject.cpp b/src/plugins/qmakeprojectmanager/qmakeproject.cpp
index 3eca1333fb4691bba8a97fad2445771a60179628..a6a31990b8f792f09efd376ffc784c159cdb6934 100644
--- a/src/plugins/qmakeprojectmanager/qmakeproject.cpp
+++ b/src/plugins/qmakeprojectmanager/qmakeproject.cpp
@@ -842,8 +842,9 @@ QStringList QmakeProject::files(FilesMode fileMode) const
 {
     QStringList files;
     for (int i = 0; i < FileTypeSize; ++i) {
-        files += m_projectFiles->files[i];
-        if (fileMode == AllFiles)
+        if (fileMode & SourceFiles)
+            files += m_projectFiles->files[i];
+        if (fileMode & GeneratedFiles)
             files += m_projectFiles->generatedFiles[i];
     }
 
@@ -1104,7 +1105,7 @@ void QmakeProject::findProFile(const FileName &fileName, QmakeProFileNode *root,
 
 void QmakeProject::notifyChanged(const FileName &name)
 {
-    if (files(QmakeProject::ExcludeGeneratedFiles).contains(name.toString())) {
+    if (files(QmakeProject::SourceFiles).contains(name.toString())) {
         QList<QmakeProFileNode *> list;
         findProFile(name, rootProjectNode(), list);
         foreach (QmakeProFileNode *node, list) {
diff --git a/src/plugins/qmljstools/qmljsmodelmanager.cpp b/src/plugins/qmljstools/qmljsmodelmanager.cpp
index e5216eaeee309064f3e0dafa4cd69f7f900d6a58..14b716cb219de80cfaffa5d83ae4e32882dfa07a 100644
--- a/src/plugins/qmljstools/qmljsmodelmanager.cpp
+++ b/src/plugins/qmljstools/qmljsmodelmanager.cpp
@@ -88,7 +88,7 @@ ModelManagerInterface::ProjectInfo ModelManager::defaultProjectInfoForProject(
                      << QLatin1String(Constants::QMLPROJECT_MIMETYPE)
                      << QLatin1String(Constants::QMLTYPES_MIMETYPE)
                      << QLatin1String(Constants::QMLUI_MIMETYPE);
-        foreach (const QString &filePath, project->files(Project::ExcludeGeneratedFiles)) {
+        foreach (const QString &filePath, project->files(Project::SourceFiles)) {
             if (qmlTypeNames.contains(mdb.mimeTypeForFile(filePath).name()))
                 projectInfo.sourceFiles << filePath;
         }
diff --git a/src/plugins/qmlprofiler/qmlprofilertool.cpp b/src/plugins/qmlprofiler/qmlprofilertool.cpp
index bcc46aed1696f92f991ac48e78d1d99383457ac5..3c92f8c19c0721e1d2512cba77a114ee3b8040cc 100644
--- a/src/plugins/qmlprofiler/qmlprofilertool.cpp
+++ b/src/plugins/qmlprofiler/qmlprofilertool.cpp
@@ -348,7 +348,7 @@ void QmlProfilerTool::populateFileFinder(QString projectDirectory, QString activ
         projects.insert(0, startupProject);
     }
     foreach (Project *project, projects)
-        sourceFiles << project->files(Project::ExcludeGeneratedFiles);
+        sourceFiles << project->files(Project::SourceFiles);
 
     if (!projects.isEmpty()) {
         if (projectDirectory.isEmpty())
diff --git a/src/plugins/qtsupport/qtoutputformatter.cpp b/src/plugins/qtsupport/qtoutputformatter.cpp
index 27eb85be3c097799b946fc5ec01a6a74a1f9a47c..eb65bf182f781e0dc094c4e5dd63481478bebd7a 100644
--- a/src/plugins/qtsupport/qtoutputformatter.cpp
+++ b/src/plugins/qtsupport/qtoutputformatter.cpp
@@ -90,7 +90,7 @@ QtOutputFormatter::QtOutputFormatter(Project *project)
     : d(new Internal::QtOutputFormatterPrivate(project))
 {
     if (project) {
-        d->projectFinder.setProjectFiles(project->files(Project::ExcludeGeneratedFiles));
+        d->projectFinder.setProjectFiles(project->files(Project::SourceFiles));
         d->projectFinder.setProjectDirectory(project->projectDirectory().toString());
 
         connect(project, SIGNAL(fileListChanged()),
@@ -284,7 +284,7 @@ void QtOutputFormatter::openEditor(const QString &fileName, int line, int column
 void QtOutputFormatter::updateProjectFileList()
 {
     if (d->project)
-        d->projectFinder.setProjectFiles(d->project.data()->files(Project::ExcludeGeneratedFiles));
+        d->projectFinder.setProjectFiles(d->project.data()->files(Project::SourceFiles));
 }
 
 } // namespace QtSupport
diff --git a/src/plugins/todo/cpptodoitemsscanner.cpp b/src/plugins/todo/cpptodoitemsscanner.cpp
index 3239a0c9b7e34d85875847a0ba31ceb3382eb0a0..85612bd8b2f0c3c987a411603db8b84719f69832 100644
--- a/src/plugins/todo/cpptodoitemsscanner.cpp
+++ b/src/plugins/todo/cpptodoitemsscanner.cpp
@@ -59,7 +59,7 @@ void CppTodoItemsScanner::scannerParamsChanged()
 
     QSet<QString> filesToBeUpdated;
     foreach (const CppTools::ProjectInfo &info, modelManager->projectInfos())
-        filesToBeUpdated.unite(info.project().data()->files(ProjectExplorer::Project::ExcludeGeneratedFiles).toSet());
+        filesToBeUpdated.unite(info.project().data()->files(ProjectExplorer::Project::SourceFiles).toSet());
 
     modelManager->updateSourceFiles(filesToBeUpdated);
 }
diff --git a/src/plugins/todo/todoitemsprovider.cpp b/src/plugins/todo/todoitemsprovider.cpp
index 2fd6a8d27d62250364775bf5b54d06cfca53e589..e295108b641feef3eef4df0a30c96765dd83e54d 100644
--- a/src/plugins/todo/todoitemsprovider.cpp
+++ b/src/plugins/todo/todoitemsprovider.cpp
@@ -124,7 +124,7 @@ void TodoItemsProvider::createScanners()
 void TodoItemsProvider::setItemsListWithinStartupProject()
 {
     QHashIterator<QString, QList<TodoItem> > it(m_itemsHash);
-    QSet<QString> fileNames = QSet<QString>::fromList(m_startupProject->files(Project::ExcludeGeneratedFiles));
+    QSet<QString> fileNames = QSet<QString>::fromList(m_startupProject->files(Project::SourceFiles));
 
     QVariantMap settings = m_startupProject->namedSettings(QLatin1String(Constants::SETTINGS_NAME_KEY)).toMap();
 
@@ -161,7 +161,7 @@ void TodoItemsProvider::setItemsListWithinSubproject()
             QSet<Utils::FileName> subprojectFileNames =
                     QSet<Utils::FileName>::fromList(filesVisitor.filePaths());
             QSet<QString> fileNames = QSet<QString>::fromList(
-                        m_startupProject->files(ProjectExplorer::Project::ExcludeGeneratedFiles));
+                        m_startupProject->files(ProjectExplorer::Project::SourceFiles));
             QHashIterator<QString, QList<TodoItem> > it(m_itemsHash);
             while (it.hasNext()) {
                 it.next();
diff --git a/src/plugins/vcsbase/vcsbasesubmiteditor.cpp b/src/plugins/vcsbase/vcsbasesubmiteditor.cpp
index 20bc29f24fa23b304b3b820650dc8d8e68e16a79..7c80b53a08306830cae5df4ccdef28d526c80b92 100644
--- a/src/plugins/vcsbase/vcsbasesubmiteditor.cpp
+++ b/src/plugins/vcsbase/vcsbasesubmiteditor.cpp
@@ -743,7 +743,7 @@ void VcsBaseSubmitEditor::filterUntrackedFilesOfProject(const QString &repositor
         return;
 
     const QSet<QString> projectFiles
-            = QSet<QString>::fromList(vcsProject->files(ProjectExplorer::Project::ExcludeGeneratedFiles));
+            = QSet<QString>::fromList(vcsProject->files(ProjectExplorer::Project::SourceFiles));
 
     if (projectFiles.empty())
         return;