diff options
8 files changed, 8 insertions, 29 deletions
diff --git a/src/plugins/autotoolsprojectmanager/autotoolsproject.cpp b/src/plugins/autotoolsprojectmanager/autotoolsproject.cpp index c37d144438..1f2922e7d0 100644 --- a/src/plugins/autotoolsprojectmanager/autotoolsproject.cpp +++ b/src/plugins/autotoolsprojectmanager/autotoolsproject.cpp @@ -305,6 +305,5 @@ void AutotoolsProject::updateCppCodeModel() foreach (Core::Id language, languages) setProjectLanguage(language, true); - pInfo.finish(); m_codeModelFuture = modelManager->updateProjectInfo(pInfo); } diff --git a/src/plugins/clangcodemodel/test/clangcodecompletion_test.cpp b/src/plugins/clangcodemodel/test/clangcodecompletion_test.cpp index cfb3d7b915..b50e958380 100644 --- a/src/plugins/clangcodemodel/test/clangcodecompletion_test.cpp +++ b/src/plugins/clangcodemodel/test/clangcodecompletion_test.cpp @@ -623,7 +623,6 @@ CppTools::ProjectInfo createProjectInfo(ProjectExplorer::Project *project, const CppTools::ProjectPart::Ptr projectPart = createProjectPart(files, defines); ProjectInfo projectInfo = ProjectInfo(project); projectInfo.appendProjectPart(projectPart); - projectInfo.finish(); return projectInfo; } diff --git a/src/plugins/cmakeprojectmanager/cmakeproject.cpp b/src/plugins/cmakeprojectmanager/cmakeproject.cpp index f9bc0013cc..8dbdb0ed7c 100644 --- a/src/plugins/cmakeprojectmanager/cmakeproject.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeproject.cpp @@ -135,7 +135,6 @@ void CMakeProject::updateProjectData(CMakeBuildConfiguration *bc) setProjectLanguage(lid, true); m_codeModelFuture.cancel(); - pinfo.finish(); m_codeModelFuture = modelmanager->updateProjectInfo(pinfo); updateQmlJSCodeModel(); diff --git a/src/plugins/cpptools/cppmodelmanager.cpp b/src/plugins/cpptools/cppmodelmanager.cpp index ac0003e3dd..201af6f6a2 100644 --- a/src/plugins/cpptools/cppmodelmanager.cpp +++ b/src/plugins/cpptools/cppmodelmanager.cpp @@ -823,21 +823,24 @@ QFuture<void> CppModelManager::updateProjectInfo(const ProjectInfo &newProjectIn if (!newProjectInfo.isValid()) return QFuture<void>(); + ProjectInfo theNewProjectInfo = newProjectInfo; + theNewProjectInfo.finish(); + QSet<QString> filesToReindex; QStringList removedProjectParts; bool filesRemoved = false; - ProjectExplorer::Project *project = newProjectInfo.project().data(); + ProjectExplorer::Project *project = theNewProjectInfo.project().data(); { // Only hold the mutex for a limited scope, so the dumping afterwards does not deadlock. QMutexLocker projectLocker(&d->m_projectMutex); - const QSet<QString> newSourceFiles = newProjectInfo.sourceFiles(); + const QSet<QString> newSourceFiles = theNewProjectInfo.sourceFiles(); // Check if we can avoid a full reindexing ProjectInfo oldProjectInfo = d->m_projectToProjectsInfo.value(project); const bool previousIndexerCanceled = d->m_projectToIndexerCanceled.value(project, false); if (!previousIndexerCanceled && oldProjectInfo.isValid()) { - ProjectInfoComparer comparer(oldProjectInfo, newProjectInfo); + ProjectInfoComparer comparer(oldProjectInfo, theNewProjectInfo); if (comparer.configurationOrFilesChanged()) { d->m_dirty = true; @@ -880,7 +883,7 @@ QFuture<void> CppModelManager::updateProjectInfo(const ProjectInfo &newProjectIn } // Update Project/ProjectInfo and File/ProjectPart table - d->m_projectToProjectsInfo.insert(project, newProjectInfo); + d->m_projectToProjectsInfo.insert(project, theNewProjectInfo); recalculateProjectPartMappings(); } // Mutex scope @@ -898,7 +901,7 @@ QFuture<void> CppModelManager::updateProjectInfo(const ProjectInfo &newProjectIn emit projectPartsRemoved(removedProjectParts); // Announce added project parts - emit projectPartsUpdated(newProjectInfo.project().data()); + emit projectPartsUpdated(theNewProjectInfo.project().data()); // Ideally, we would update all the editor documents that depend on the 'filesToReindex'. // However, on e.g. a session restore first the editor documents are created and then the diff --git a/src/plugins/cpptools/cppmodelmanager_test.cpp b/src/plugins/cpptools/cppmodelmanager_test.cpp index 92bbebf91d..38e194dde6 100644 --- a/src/plugins/cpptools/cppmodelmanager_test.cpp +++ b/src/plugins/cpptools/cppmodelmanager_test.cpp @@ -115,7 +115,6 @@ public: part->files.append(projectFile); } projectInfo.appendProjectPart(part); - projectInfo.finish(); } ModelManagerTestHelper *modelManagerTestHelper; @@ -194,7 +193,6 @@ void CppToolsPlugin::test_modelmanager_paths_are_clean() part->headerPaths = { HeaderPath(testDataDir.includeDir(false), HeaderPath::IncludePath), HeaderPath(testDataDir.frameworksDir(false), HeaderPath::FrameworkPath) }; pi.appendProjectPart(part); - pi.finish(); mm->updateProjectInfo(pi); @@ -231,7 +229,6 @@ void CppToolsPlugin::test_modelmanager_framework_headers() _("test_modelmanager_framework_headers.cpp")); part->files << ProjectFile(source, ProjectFile::CXXSource); pi.appendProjectPart(part); - pi.finish(); mm->updateProjectInfo(pi).waitForFinished(); QCoreApplication::processEvents(); @@ -279,7 +276,6 @@ void CppToolsPlugin::test_modelmanager_refresh_also_includes_of_project_files() part->headerPaths = { HeaderPath(testDataDir.includeDir(false), HeaderPath::IncludePath) }; part->files.append(ProjectFile(testCpp, ProjectFile::CXXSource)); pi.appendProjectPart(part); - pi.finish(); QSet<QString> refreshedFiles = helper.updateProjectInfo(pi); QCOMPARE(refreshedFiles.size(), 1); @@ -297,7 +293,6 @@ void CppToolsPlugin::test_modelmanager_refresh_also_includes_of_project_files() part->projectDefines = QByteArray("#define TEST_DEFINE 1\n"); pi = ProjectInfo(project); pi.appendProjectPart(part); - pi.finish(); refreshedFiles = helper.updateProjectInfo(pi); @@ -338,7 +333,6 @@ void CppToolsPlugin::test_modelmanager_refresh_several_times() part->files.append(ProjectFile(testHeader2, ProjectFile::CXXHeader)); part->files.append(ProjectFile(testCpp, ProjectFile::CXXSource)); pi.appendProjectPart(part); - pi.finish(); mm->updateProjectInfo(pi); CPlusPlus::Snapshot snapshot; @@ -358,7 +352,6 @@ void CppToolsPlugin::test_modelmanager_refresh_several_times() part->files.append(ProjectFile(testHeader2, ProjectFile::CXXHeader)); part->files.append(ProjectFile(testCpp, ProjectFile::CXXSource)); pi.appendProjectPart(part); - pi.finish(); refreshedFiles = helper.updateProjectInfo(pi); QCOMPARE(refreshedFiles.size(), 3); @@ -402,7 +395,6 @@ void CppToolsPlugin::test_modelmanager_refresh_test_for_changes() part->qtVersion = ProjectPart::Qt5; part->files.append(ProjectFile(testCpp, ProjectFile::CXXSource)); pi.appendProjectPart(part); - pi.finish(); // Reindexing triggers a reparsing thread helper.resetRefreshedSourceFiles(); @@ -440,7 +432,6 @@ void CppToolsPlugin::test_modelmanager_refresh_added_and_purge_removed() part->files.append(ProjectFile(testCpp, ProjectFile::CXXSource)); part->files.append(ProjectFile(testHeader1, ProjectFile::CXXHeader)); pi.appendProjectPart(part); - pi.finish(); CPlusPlus::Snapshot snapshot; QSet<QString> refreshedFiles; @@ -463,7 +454,6 @@ void CppToolsPlugin::test_modelmanager_refresh_added_and_purge_removed() newPart->files.append(ProjectFile(testCpp, ProjectFile::CXXSource)); newPart->files.append(ProjectFile(testHeader2, ProjectFile::CXXHeader)); pi.appendProjectPart(newPart); - pi.finish(); refreshedFiles = helper.updateProjectInfo(pi); @@ -505,7 +495,6 @@ void CppToolsPlugin::test_modelmanager_refresh_timeStampModified_if_sourcefiles_ part->files.append(ProjectFile(file, ProjectFile::CXXSource)); pi = ProjectInfo(project); pi.appendProjectPart(part); - pi.finish(); Document::Ptr document; CPlusPlus::Snapshot snapshot; @@ -539,7 +528,6 @@ void CppToolsPlugin::test_modelmanager_refresh_timeStampModified_if_sourcefiles_ part->files.append(ProjectFile(file, ProjectFile::CXXSource)); pi = ProjectInfo(project); pi.appendProjectPart(part); - pi.finish(); refreshedFiles = helper.updateProjectInfo(pi); @@ -804,7 +792,6 @@ void CppToolsPlugin::test_modelmanager_defines_per_project() ProjectInfo pi = ProjectInfo(project); pi.appendProjectPart(part1); pi.appendProjectPart(part2); - pi.finish(); helper.updateProjectInfo(pi); QCOMPARE(mm->snapshot().size(), 4); @@ -873,7 +860,6 @@ void CppToolsPlugin::test_modelmanager_precompiled_headers() ProjectInfo pi = ProjectInfo(project); pi.appendProjectPart(part1); pi.appendProjectPart(part2); - pi.finish(); helper.updateProjectInfo(pi); QCOMPARE(mm->snapshot().size(), 4); @@ -955,7 +941,6 @@ void CppToolsPlugin::test_modelmanager_defines_per_editor() ProjectInfo pi = ProjectInfo(project); pi.appendProjectPart(part1); pi.appendProjectPart(part2); - pi.finish(); helper.updateProjectInfo(pi); @@ -1035,7 +1020,6 @@ void CppToolsPlugin::test_modelmanager_updateEditorsAfterProjectUpdate() ProjectInfo pi = ProjectInfo(project); pi.appendProjectPart(part); - pi.finish(); helper.updateProjectInfo(pi); // ... and check for updated editor document A diff --git a/src/plugins/genericprojectmanager/genericproject.cpp b/src/plugins/genericprojectmanager/genericproject.cpp index 264b2e8b24..76dd9f4407 100644 --- a/src/plugins/genericprojectmanager/genericproject.cpp +++ b/src/plugins/genericprojectmanager/genericproject.cpp @@ -371,7 +371,6 @@ void GenericProject::refreshCppCodeModel() foreach (Id language, languages) setProjectLanguage(language, true); - pInfo.finish(); m_codeModelFuture = modelManager->updateProjectInfo(pInfo); } diff --git a/src/plugins/qbsprojectmanager/qbsproject.cpp b/src/plugins/qbsprojectmanager/qbsproject.cpp index f037f04814..57841c1688 100644 --- a/src/plugins/qbsprojectmanager/qbsproject.cpp +++ b/src/plugins/qbsprojectmanager/qbsproject.cpp @@ -1030,8 +1030,6 @@ void QbsProject::updateCppCodeModel() } } - pinfo.finish(); - CppTools::GeneratedCodeModelSupport::update(m_extraCompilers); // Update the code model diff --git a/src/plugins/qmakeprojectmanager/qmakeproject.cpp b/src/plugins/qmakeprojectmanager/qmakeproject.cpp index 94aeef48e7..aab83f38a4 100644 --- a/src/plugins/qmakeprojectmanager/qmakeproject.cpp +++ b/src/plugins/qmakeprojectmanager/qmakeproject.cpp @@ -473,8 +473,6 @@ void QmakeProject::updateCppCodeModel() } } - projectInfo.finish(); - CppTools::GeneratedCodeModelSupport::update(generators); m_codeModelFuture = CppTools::CppModelManager::instance()->updateProjectInfo(projectInfo); } |