Commit 42d570a3 authored by Ulf Hermann's avatar Ulf Hermann

Rename Project::ExcludeGeneratedFiles

We want to distinguish between source files and generated files. So
let's call them by their names.

Change-Id: I324c4b82ca7fb7d8d0e175ea6c4f14f1306ec929
Reviewed-by: default avatarTobias Hunger <tobias.hunger@theqtcompany.com>
parent 0e012a83
...@@ -651,7 +651,7 @@ void Parser::resetData(const CPlusPlus::Snapshot &snapshot) ...@@ -651,7 +651,7 @@ void Parser::resetData(const CPlusPlus::Snapshot &snapshot)
// check all projects // check all projects
foreach (const Project *prj, SessionManager::projects()) { foreach (const Project *prj, SessionManager::projects()) {
if (prj) if (prj)
fileList += prj->files(Project::ExcludeGeneratedFiles); fileList += prj->files(Project::SourceFiles);
} }
setFileList(fileList); setFileList(fileList);
......
...@@ -2078,8 +2078,7 @@ void ClearCasePlugin::updateIndex() ...@@ -2078,8 +2078,7 @@ void ClearCasePlugin::updateIndex()
return; return;
m_checkInAllAction->setEnabled(false); m_checkInAllAction->setEnabled(false);
m_statusMap->clear(); m_statusMap->clear();
QFuture<void> result = QtConcurrent::run(&sync, QFuture<void> result = QtConcurrent::run(&sync, project->files(Project::SourceFiles));
project->files(Project::ExcludeGeneratedFiles));
if (!m_settings.disableIndexer) if (!m_settings.disableIndexer)
ProgressManager::addTask(result, tr("Updating ClearCase Index"), ClearCase::Constants::TASK_INDEX); ProgressManager::addTask(result, tr("Updating ClearCase Index"), ClearCase::Constants::TASK_INDEX);
} }
......
...@@ -1539,7 +1539,7 @@ void DebuggerPluginPrivate::attachToQmlPort() ...@@ -1539,7 +1539,7 @@ void DebuggerPluginPrivate::attachToQmlPort()
} }
QStringList sourceFiles; QStringList sourceFiles;
foreach (Project *project, projects) foreach (Project *project, projects)
sourceFiles << project->files(Project::ExcludeGeneratedFiles); sourceFiles << project->files(Project::SourceFiles);
rp.projectSourceDirectory = rp.projectSourceDirectory =
!projects.isEmpty() ? projects.first()->projectDirectory().toString() : QString(); !projects.isEmpty() ? projects.first()->projectDirectory().toString() : QString();
......
...@@ -421,10 +421,10 @@ void DebuggerRunControlCreator::enrich(const RunConfiguration *runConfig, const ...@@ -421,10 +421,10 @@ void DebuggerRunControlCreator::enrich(const RunConfiguration *runConfig, const
m_rp.projectSourceDirectory = m_project->projectDirectory().toString(); m_rp.projectSourceDirectory = m_project->projectDirectory().toString();
if (m_project && m_rp.projectSourceFiles.isEmpty()) 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()) 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) { if (false && m_project && m_kit) {
const QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(m_kit); const QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(m_kit);
...@@ -453,7 +453,7 @@ void DebuggerRunControlCreator::enrich(const RunConfiguration *runConfig, const ...@@ -453,7 +453,7 @@ void DebuggerRunControlCreator::enrich(const RunConfiguration *runConfig, const
if (m_project) { if (m_project) {
m_rp.projectSourceDirectory = m_project->projectDirectory().toString(); 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) if (m_runConfig)
......
...@@ -388,7 +388,7 @@ void ModelIndexer::onProjectFileListChanged(ProjectExplorer::Project *project) ...@@ -388,7 +388,7 @@ void ModelIndexer::onProjectFileListChanged(ProjectExplorer::Project *project)
void ModelIndexer::scanProject(ProjectExplorer::Project *project) void ModelIndexer::scanProject(ProjectExplorer::Project *project)
{ {
// TODO harmonize following code with findFirstModel()? // TODO harmonize following code with findFirstModel()?
QStringList files = project->files(ProjectExplorer::Project::ExcludeGeneratedFiles); QStringList files = project->files(ProjectExplorer::Project::SourceFiles);
QQueue<QueuedFile> filesQueue; QQueue<QueuedFile> filesQueue;
QSet<QueuedFile> filesSet; QSet<QueuedFile> filesSet;
...@@ -471,7 +471,7 @@ QString ModelIndexer::findFirstModel(ProjectExplorer::FolderNode *folderNode) ...@@ -471,7 +471,7 @@ QString ModelIndexer::findFirstModel(ProjectExplorer::FolderNode *folderNode)
void ModelIndexer::forgetProject(ProjectExplorer::Project *project) void ModelIndexer::forgetProject(ProjectExplorer::Project *project)
{ {
QStringList files = project->files(ProjectExplorer::Project::ExcludeGeneratedFiles); QStringList files = project->files(ProjectExplorer::Project::SourceFiles);
QMutexLocker locker(&d->indexerMutex); QMutexLocker locker(&d->indexerMutex);
foreach (const QString &file, files) { foreach (const QString &file, files) {
......
...@@ -114,7 +114,11 @@ public: ...@@ -114,7 +114,11 @@ public:
enum class RestoreResult { Ok, Error, UserAbort }; enum class RestoreResult { Ok, Error, UserAbort };
RestoreResult restoreSettings(QString *errorMessage); RestoreResult restoreSettings(QString *errorMessage);
enum FilesMode { AllFiles, ExcludeGeneratedFiles }; enum FilesMode {
SourceFiles = 0x1,
GeneratedFiles = 0x2,
AllFiles = SourceFiles | GeneratedFiles
};
virtual QStringList files(FilesMode fileMode) const = 0; virtual QStringList files(FilesMode fileMode) const = 0;
// TODO: generalize to find source(s) of generated files? // TODO: generalize to find source(s) of generated files?
virtual QString generatedUiHeader(const Utils::FileName &formFile) const; virtual QString generatedUiHeader(const Utils::FileName &formFile) const;
......
...@@ -842,8 +842,9 @@ QStringList QmakeProject::files(FilesMode fileMode) const ...@@ -842,8 +842,9 @@ QStringList QmakeProject::files(FilesMode fileMode) const
{ {
QStringList files; QStringList files;
for (int i = 0; i < FileTypeSize; ++i) { for (int i = 0; i < FileTypeSize; ++i) {
files += m_projectFiles->files[i]; if (fileMode & SourceFiles)
if (fileMode == AllFiles) files += m_projectFiles->files[i];
if (fileMode & GeneratedFiles)
files += m_projectFiles->generatedFiles[i]; files += m_projectFiles->generatedFiles[i];
} }
...@@ -1104,7 +1105,7 @@ void QmakeProject::findProFile(const FileName &fileName, QmakeProFileNode *root, ...@@ -1104,7 +1105,7 @@ void QmakeProject::findProFile(const FileName &fileName, QmakeProFileNode *root,
void QmakeProject::notifyChanged(const FileName &name) void QmakeProject::notifyChanged(const FileName &name)
{ {
if (files(QmakeProject::ExcludeGeneratedFiles).contains(name.toString())) { if (files(QmakeProject::SourceFiles).contains(name.toString())) {
QList<QmakeProFileNode *> list; QList<QmakeProFileNode *> list;
findProFile(name, rootProjectNode(), list); findProFile(name, rootProjectNode(), list);
foreach (QmakeProFileNode *node, list) { foreach (QmakeProFileNode *node, list) {
......
...@@ -88,7 +88,7 @@ ModelManagerInterface::ProjectInfo ModelManager::defaultProjectInfoForProject( ...@@ -88,7 +88,7 @@ ModelManagerInterface::ProjectInfo ModelManager::defaultProjectInfoForProject(
<< QLatin1String(Constants::QMLPROJECT_MIMETYPE) << QLatin1String(Constants::QMLPROJECT_MIMETYPE)
<< QLatin1String(Constants::QMLTYPES_MIMETYPE) << QLatin1String(Constants::QMLTYPES_MIMETYPE)
<< QLatin1String(Constants::QMLUI_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())) if (qmlTypeNames.contains(mdb.mimeTypeForFile(filePath).name()))
projectInfo.sourceFiles << filePath; projectInfo.sourceFiles << filePath;
} }
......
...@@ -348,7 +348,7 @@ void QmlProfilerTool::populateFileFinder(QString projectDirectory, QString activ ...@@ -348,7 +348,7 @@ void QmlProfilerTool::populateFileFinder(QString projectDirectory, QString activ
projects.insert(0, startupProject); projects.insert(0, startupProject);
} }
foreach (Project *project, projects) foreach (Project *project, projects)
sourceFiles << project->files(Project::ExcludeGeneratedFiles); sourceFiles << project->files(Project::SourceFiles);
if (!projects.isEmpty()) { if (!projects.isEmpty()) {
if (projectDirectory.isEmpty()) if (projectDirectory.isEmpty())
......
...@@ -90,7 +90,7 @@ QtOutputFormatter::QtOutputFormatter(Project *project) ...@@ -90,7 +90,7 @@ QtOutputFormatter::QtOutputFormatter(Project *project)
: d(new Internal::QtOutputFormatterPrivate(project)) : d(new Internal::QtOutputFormatterPrivate(project))
{ {
if (project) { if (project) {
d->projectFinder.setProjectFiles(project->files(Project::ExcludeGeneratedFiles)); d->projectFinder.setProjectFiles(project->files(Project::SourceFiles));
d->projectFinder.setProjectDirectory(project->projectDirectory().toString()); d->projectFinder.setProjectDirectory(project->projectDirectory().toString());
connect(project, SIGNAL(fileListChanged()), connect(project, SIGNAL(fileListChanged()),
...@@ -284,7 +284,7 @@ void QtOutputFormatter::openEditor(const QString &fileName, int line, int column ...@@ -284,7 +284,7 @@ void QtOutputFormatter::openEditor(const QString &fileName, int line, int column
void QtOutputFormatter::updateProjectFileList() void QtOutputFormatter::updateProjectFileList()
{ {
if (d->project) if (d->project)
d->projectFinder.setProjectFiles(d->project.data()->files(Project::ExcludeGeneratedFiles)); d->projectFinder.setProjectFiles(d->project.data()->files(Project::SourceFiles));
} }
} // namespace QtSupport } // namespace QtSupport
......
...@@ -59,7 +59,7 @@ void CppTodoItemsScanner::scannerParamsChanged() ...@@ -59,7 +59,7 @@ void CppTodoItemsScanner::scannerParamsChanged()
QSet<QString> filesToBeUpdated; QSet<QString> filesToBeUpdated;
foreach (const CppTools::ProjectInfo &info, modelManager->projectInfos()) 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); modelManager->updateSourceFiles(filesToBeUpdated);
} }
......
...@@ -124,7 +124,7 @@ void TodoItemsProvider::createScanners() ...@@ -124,7 +124,7 @@ void TodoItemsProvider::createScanners()
void TodoItemsProvider::setItemsListWithinStartupProject() void TodoItemsProvider::setItemsListWithinStartupProject()
{ {
QHashIterator<QString, QList<TodoItem> > it(m_itemsHash); 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(); QVariantMap settings = m_startupProject->namedSettings(QLatin1String(Constants::SETTINGS_NAME_KEY)).toMap();
...@@ -161,7 +161,7 @@ void TodoItemsProvider::setItemsListWithinSubproject() ...@@ -161,7 +161,7 @@ void TodoItemsProvider::setItemsListWithinSubproject()
QSet<Utils::FileName> subprojectFileNames = QSet<Utils::FileName> subprojectFileNames =
QSet<Utils::FileName>::fromList(filesVisitor.filePaths()); QSet<Utils::FileName>::fromList(filesVisitor.filePaths());
QSet<QString> fileNames = QSet<QString>::fromList( 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); QHashIterator<QString, QList<TodoItem> > it(m_itemsHash);
while (it.hasNext()) { while (it.hasNext()) {
it.next(); it.next();
......
...@@ -743,7 +743,7 @@ void VcsBaseSubmitEditor::filterUntrackedFilesOfProject(const QString &repositor ...@@ -743,7 +743,7 @@ void VcsBaseSubmitEditor::filterUntrackedFilesOfProject(const QString &repositor
return; return;
const QSet<QString> projectFiles const QSet<QString> projectFiles
= QSet<QString>::fromList(vcsProject->files(ProjectExplorer::Project::ExcludeGeneratedFiles)); = QSet<QString>::fromList(vcsProject->files(ProjectExplorer::Project::SourceFiles));
if (projectFiles.empty()) if (projectFiles.empty())
return; return;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment