QString CppToolsBridgeQtCreatorImplementation::projectPartIdForFile(const QString &filePath) const { const CppTools::ProjectPart::Ptr projectPart = projectPartForFile(filePath); if (isProjectPartValid(projectPart)) return projectPart->id(); // OK, Project Part is still loaded return QString(); }
void ClangEditorDocumentProcessor::updateProjectPartAndTranslationUnitForEditor() { const CppTools::ProjectPart::Ptr projectPart = m_parser->projectPart(); if (isProjectPartLoadedOrIsFallback(projectPart)) { registerTranslationUnitForEditor(projectPart.data()); m_projectPart = projectPart; } }
void ClangEditorDocumentProcessor::updateProjectPartAndTranslationUnitForEditor() { const CppTools::ProjectPart::Ptr projectPart = m_parser->projectPart(); QTC_ASSERT(projectPart, return); updateTranslationUnitForEditor(*projectPart.data()); requestDiagnostics(*projectPart.data()); m_projectPart = projectPart; }
static bool isProjectPartLoadedOrIsFallback(CppTools::ProjectPart::Ptr projectPart) { return projectPart && (projectPart->id().isEmpty() || ClangCodeModel::Utils::isProjectPartLoaded(projectPart)); }