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)
// check all projects
foreach (const Project *prj, SessionManager::projects()) {
if (prj)
fileList += prj->files(Project::ExcludeGeneratedFiles);
fileList += prj->files(Project::SourceFiles);
}
setFileList(fileList);
......
......@@ -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);
}
......
......@@ -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();
......
......@@ -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)
......
......@@ -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) {
......
......@@ -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;
......
......@@ -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) {
......
......@@ -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;
}
......
......@@ -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())
......
......@@ -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
......
......@@ -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);
}
......
......@@ -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();
......
......@@ -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;
......
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