C++: Move preprocessor settings handling to the document.

This cleans up the handling of those settings, and makes sure that the
C++ document is setting those settings before parsing. This also
prevents lock contention in the parser, because before this patch the
document would kick of the initial parse (after opening a document),
after which the editor would come in and try to set the preprocessor
settings, resulting in the UI thread locking until the initial parse was
done.

Change-Id: Ia2e18a9667e10279f045c1c5849046ec4cfe85ae
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
This commit is contained in:
Erik Verbruggen
2014-09-09 16:02:31 +02:00
committed by Nikolai Kosjar
parent 914adeab82
commit cc6a9babe0
5 changed files with 52 additions and 37 deletions

View File

@@ -95,7 +95,7 @@ int CppPreProcessorDialog::exec()
ProjectExplorer::SessionManager::setValue(
QLatin1String(Constants::CPP_PREPROCESSOR_PROJECT_PREFIX) + m_filePath,
m_partAdditions[m_ui->projectComboBox->currentIndex()].projectPart->id());
m_partAdditions[m_ui->projectComboBox->currentIndex()].projectPart->projectFile);
foreach (ProjectPartAddition partAddition, m_partAdditions) {
const QString &previousDirectives = ProjectExplorer::SessionManager::value(