diff options
author | Erik Verbruggen <erik.verbruggen@digia.com> | 2013-12-10 12:53:20 +0100 |
---|---|---|
committer | Erik Verbruggen <erik.verbruggen@digia.com> | 2013-12-10 12:53:20 +0100 |
commit | 9f831dde07cb2411808534e76669b28a1b76e21d (patch) | |
tree | ed6252d64c9a3ab27aa93786272cda1b6008f3c7 /src/plugins/cppeditor/cppeditor.cpp | |
parent | cdac81f896ef4b052d76f96485a08e6ec13696b8 (diff) | |
parent | ea1a92484ac99057b06130a012164bf9788650e9 (diff) | |
download | qt-creator-wip/clang.tar.gz |
Merge remote-tracking branch 'origin/master' into wip/clangwip/clang
Change-Id: I8a2c8068a3f2b15034fb1bf6304c9a0f3f0e3c8f
Diffstat (limited to 'src/plugins/cppeditor/cppeditor.cpp')
-rw-r--r-- | src/plugins/cppeditor/cppeditor.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/plugins/cppeditor/cppeditor.cpp b/src/plugins/cppeditor/cppeditor.cpp index f617545bd1..682adf61cc 100644 --- a/src/plugins/cppeditor/cppeditor.cpp +++ b/src/plugins/cppeditor/cppeditor.cpp @@ -717,6 +717,9 @@ void CPPEditorWidget::setMimeType(const QString &mt) = m_modelManager->cppEditorSupport(editor())->snapshotUpdater(); updater->setEditorDefines(additionalDirectives); + m_preprocessorButton->setProperty("highlightWidget", !additionalDirectives.trimmed().isEmpty()); + m_preprocessorButton->update(); + BaseTextEditorWidget::setMimeType(mt); setObjCEnabled(mt == QLatin1String(CppTools::Constants::OBJECTIVE_C_SOURCE_MIMETYPE) || mt == QLatin1String(CppTools::Constants::OBJECTIVE_CPP_SOURCE_MIMETYPE)); @@ -1995,8 +1998,12 @@ void CPPEditorWidget::showPreProcessorWidget() if (preProcessorDialog.exec() == QDialog::Accepted) { QSharedPointer<SnapshotUpdater> updater = m_modelManager->cppEditorSupport(editor())->snapshotUpdater(); - updater->setEditorDefines(preProcessorDialog.additionalPreProcessorDirectives().toUtf8()); + const QString &additionals = preProcessorDialog.additionalPreProcessorDirectives(); + updater->setEditorDefines(additionals.toUtf8()); updater->update(m_modelManager->workingCopy()); + + m_preprocessorButton->setProperty("highlightWidget", !additionals.trimmed().isEmpty()); + m_preprocessorButton->update(); } } |