From c1225ea3f4bd534f8edc982e77d300c6e93219c7 Mon Sep 17 00:00:00 2001 From: Nikolai Kosjar Date: Thu, 14 Nov 2013 10:59:46 +0100 Subject: CppTools: Use editor manager's codec as fallback ...for reading not already opened files. This partly reverts commit f7c68f6. In case TextFileFormat::detect() fails, the user configurable editor manager's codec is used instead of QTextCodec::codecForLocale(). Adds also a qWarning() to easier detect encoding errors. Task-number: QTCREATORBUG-10378 Change-Id: I0fa4e6b898ed090d85414ce2a001f11b115a42d3 Reviewed-by: Oswald Buddenhagen Reviewed-by: Eike Ziller Reviewed-by: Erik Verbruggen --- src/plugins/cpptools/cpppreprocessor.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/plugins/cpptools/cpppreprocessor.h') diff --git a/src/plugins/cpptools/cpppreprocessor.h b/src/plugins/cpptools/cpppreprocessor.h index d0d84ac8e3..40a9509701 100644 --- a/src/plugins/cpptools/cpppreprocessor.h +++ b/src/plugins/cpptools/cpppreprocessor.h @@ -9,6 +9,10 @@ #include #include +QT_BEGIN_NAMESPACE +class QTextCodec; +QT_END_NAMESPACE + namespace CppTools { namespace Internal { @@ -75,6 +79,7 @@ protected: virtual void sourceNeeded(unsigned line, const QString &fileName, IncludeType type); private: + CppPreprocessor(); void addFrameworkPath(const QString &frameworkPath); CPlusPlus::Snapshot m_snapshot; @@ -92,6 +97,7 @@ private: QSet m_processed; unsigned m_revision; QHash m_fileNameCache; + QTextCodec *m_defaultCodec; }; } // namespace Internal -- cgit v1.2.1