summaryrefslogtreecommitdiff
path: root/src/plugins/cpptools/cppqtstyleindenter.cpp
diff options
context:
space:
mode:
authorJarek Kobus <jkobus@trolltech.com>2011-08-16 10:45:23 +0200
committerJarek Kobus <jaroslaw.kobus@nokia.com>2011-09-23 10:23:15 +0200
commit224491182666840def3a551a840c8fa840bfe5c2 (patch)
tree0c75ae3cc76819f373c1642ffd598e57568dac54 /src/plugins/cpptools/cppqtstyleindenter.cpp
parent3955df7855c9d27d8d470f509578bd9004b72ea1 (diff)
downloadqt-creator-224491182666840def3a551a840c8fa840bfe5c2.tar.gz
Implement Code Style schemes
Task-number: QTCREATORBUG-5092 Change-Id: I218cef02f7c242e4dfae59b1b8021ea618e60d07 Reviewed-on: http://codereview.qt-project.org/5160 Reviewed-by: Leandro T. C. Melo <leandro.melo@nokia.com>
Diffstat (limited to 'src/plugins/cpptools/cppqtstyleindenter.cpp')
-rw-r--r--src/plugins/cpptools/cppqtstyleindenter.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/plugins/cpptools/cppqtstyleindenter.cpp b/src/plugins/cpptools/cppqtstyleindenter.cpp
index 64ac333e96..654b3ebe9e 100644
--- a/src/plugins/cpptools/cppqtstyleindenter.cpp
+++ b/src/plugins/cpptools/cppqtstyleindenter.cpp
@@ -51,7 +51,7 @@ CppQtStyleIndenter::CppQtStyleIndenter()
{
// Just for safety. setCodeStylePreferences should be called when the editor the
// indenter belongs to gets initialized.
- m_cppCodeStylePreferences = CppToolsSettings::instance()->cppCodeStylePreferences();
+ m_cppCodeStylePreferences = CppToolsSettings::instance()->cppCodeStyle();
}
CppQtStyleIndenter::~CppQtStyleIndenter()
@@ -148,7 +148,7 @@ void CppQtStyleIndenter::indent(QTextDocument *doc,
}
}
-void CppQtStyleIndenter::setCodeStylePreferences(TextEditor::IFallbackPreferences *preferences)
+void CppQtStyleIndenter::setCodeStylePreferences(TextEditor::ICodeStylePreferences *preferences)
{
CppTools::CppCodeStylePreferences *cppCodeStylePreferences
= qobject_cast<CppTools::CppCodeStylePreferences *>(preferences);
@@ -156,9 +156,15 @@ void CppQtStyleIndenter::setCodeStylePreferences(TextEditor::IFallbackPreference
m_cppCodeStylePreferences = cppCodeStylePreferences;
}
+void CppQtStyleIndenter::invalidateCache(QTextDocument *doc)
+{
+ CppTools::QtStyleCodeFormatter formatter;
+ formatter.invalidateCache(doc);
+}
+
CppCodeStyleSettings CppQtStyleIndenter::codeStyleSettings() const
{
if (m_cppCodeStylePreferences)
- return m_cppCodeStylePreferences->currentSettings();
+ return m_cppCodeStylePreferences->currentCodeStyleSettings();
return CppCodeStyleSettings();
}