summaryrefslogtreecommitdiff
path: root/src/plugins/cpptools/baseeditordocumentprocessor.cpp
diff options
context:
space:
mode:
authorNikolai Kosjar <nikolai.kosjar@qt.io>2017-01-12 18:01:12 +0100
committerNikolai Kosjar <nikolai.kosjar@qt.io>2017-01-16 10:17:50 +0000
commite4e65726614fa4e3ee02f25db755d959850441ea (patch)
treea76a4aab899eb313f25f0da8a1f3e89ede71b67b /src/plugins/cpptools/baseeditordocumentprocessor.cpp
parent4416eecc024e155438c7ed6399182dbff143bd0d (diff)
downloadqt-creator-e4e65726614fa4e3ee02f25db755d959850441ea.tar.gz
CppTools: Allow interpreting ambiguous headers as C headers
...instead of C++ headers. For the Clang Code Model this results in using "-x c-header" instead of "-x c++-header". This introduces a new option in Options > C++ > "Code Model" to configure this. Change-Id: I8a0ce8fa6155f5ef58743ebc7f1d0b500fbf6599 Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Diffstat (limited to 'src/plugins/cpptools/baseeditordocumentprocessor.cpp')
-rw-r--r--src/plugins/cpptools/baseeditordocumentprocessor.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/plugins/cpptools/baseeditordocumentprocessor.cpp b/src/plugins/cpptools/baseeditordocumentprocessor.cpp
index bf68bc1c4e..b656c5798a 100644
--- a/src/plugins/cpptools/baseeditordocumentprocessor.cpp
+++ b/src/plugins/cpptools/baseeditordocumentprocessor.cpp
@@ -25,8 +25,11 @@
#include "baseeditordocumentprocessor.h"
+#include "cppcodemodelsettings.h"
+#include "cpplanguage.h"
#include "cppmodelmanager.h"
#include "cpptoolsbridge.h"
+#include "cpptoolsreuse.h"
#include "editordocumenthandle.h"
#include <projectexplorer/session.h>
@@ -55,8 +58,13 @@ BaseEditorDocumentProcessor::~BaseEditorDocumentProcessor()
void BaseEditorDocumentProcessor::run(bool hasActiveProjectChanged)
{
+ const Language languagePreference = codeModelSettings()->interpretAmbigiousHeadersAsCHeaders()
+ ? Language::C
+ : Language::Cxx;
+
runImpl({CppModelManager::instance()->workingCopy(),
ProjectExplorer::SessionManager::startupProject(),
+ languagePreference,
hasActiveProjectChanged});
}