CppEditor: Use the project part chosen with CppPreProcessorDialog

...otherwise the CppPreProcessorDialog is only semi-useful.

Change-Id: I6b80967b05e7c9a51cd78ae064a3d78170948e32
Reviewed-by: David Schulz <david.schulz@digia.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
This commit is contained in:
Nikolai Kosjar
2013-12-02 15:23:13 +01:00
parent 3baa1b35e2
commit a8e7b6bd38
6 changed files with 22 additions and 2 deletions

View File

@@ -715,6 +715,7 @@ void CPPEditorWidget::setMimeType(const QString &mt)
QSharedPointer<SnapshotUpdater> updater
= m_modelManager->cppEditorSupport(editor())->snapshotUpdater();
updater->setProjectPart(m_modelManager->projectPartForProjectFile(projectFile));
updater->setEditorDefines(additionalDirectives);
m_preprocessorButton->setProperty("highlightWidget", !additionalDirectives.trimmed().isEmpty());
@@ -1994,6 +1995,7 @@ void CPPEditorWidget::showPreProcessorWidget()
QSharedPointer<SnapshotUpdater> updater
= m_modelManager->cppEditorSupport(editor())->snapshotUpdater();
const QString &additionals = preProcessorDialog.additionalPreProcessorDirectives();
updater->setProjectPart(preProcessorDialog.projectPart());
updater->setEditorDefines(additionals.toUtf8());
updater->update(m_modelManager->workingCopy());