コード例 #1
0
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();
}
コード例 #2
0
void ClangEditorDocumentProcessor::updateProjectPartAndTranslationUnitForEditor()
{
    const CppTools::ProjectPart::Ptr projectPart = m_parser->projectPart();

    if (isProjectPartLoadedOrIsFallback(projectPart)) {
        registerTranslationUnitForEditor(projectPart.data());

        m_projectPart = projectPart;
    }
}
コード例 #3
0
void ClangEditorDocumentProcessor::updateProjectPartAndTranslationUnitForEditor()
{
    const CppTools::ProjectPart::Ptr projectPart = m_parser->projectPart();
    QTC_ASSERT(projectPart, return);

    updateTranslationUnitForEditor(*projectPart.data());
    requestDiagnostics(*projectPart.data());

    m_projectPart = projectPart;
}
コード例 #4
0
static bool isProjectPartLoadedOrIsFallback(CppTools::ProjectPart::Ptr projectPart)
{
    return projectPart
        && (projectPart->id().isEmpty() || ClangCodeModel::Utils::isProjectPartLoaded(projectPart));
}