void PchManager::clangProjectSettingsChanged() { ClangProjectSettings *cps = qobject_cast<ClangProjectSettings *>(sender()); if (!cps) return; onProjectPartsUpdated(cps->project()); }
static Core::Id configIdForProject(ClangProjectSettings &projectSettings) { if (projectSettings.useGlobalConfig()) return CppTools::codeModelSettings()->clangDiagnosticConfigId(); Core::Id configId = projectSettings.warningConfigId(); if (!configId.isValid()) { configId = CppTools::codeModelSettings()->clangDiagnosticConfigId(); projectSettings.setWarningConfigId(configId); } return configId; }
void PchManager::onProjectPartsUpdated(ProjectExplorer::Project *project) { ClangProjectSettings *cps = settingsForProject(project); Q_ASSERT(cps); CppTools::CppModelManagerInterface *mmi = CppTools::CppModelManagerInterface::instance(); const QList<ProjectPart::Ptr> projectParts = mmi->projectInfo( cps->project()).projectParts(); updatePchInfo(cps, projectParts); emit pchInfoUpdated(); }
ClangProjectSettings *PchManager::settingsForProject(ProjectExplorer::Project *project) { QMutexLocker locker(&m_mutex); ClangProjectSettings *cps = m_projectSettings.value(project); if (!cps) { cps = new ClangProjectSettings(project); m_projectSettings.insert(project, cps); cps->pullSettings(); connect(cps, SIGNAL(pchSettingsChanged()), this, SLOT(clangProjectSettingsChanged())); } return cps; }
static Core::Id configIdForProject(const ClangProjectSettings &projectSettings) { return projectSettings.useGlobalWarningConfig() ? Core::Id(GLOBAL_PROXY_CONFIG_ID) : projectSettings.warningConfigId(); }