forked from qt-creator/qt-creator
CppTools: modernize
Change-Id: Iaf02e4d026f1ac8b216833d83cd7a735e21ff60a Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io> Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
@@ -37,15 +37,13 @@
|
||||
using namespace CppTools;
|
||||
|
||||
CppQtStyleIndenter::CppQtStyleIndenter()
|
||||
: m_cppCodeStylePreferences(0)
|
||||
{
|
||||
// Just for safety. setCodeStylePreferences should be called when the editor the
|
||||
// indenter belongs to gets initialized.
|
||||
m_cppCodeStylePreferences = CppToolsSettings::instance()->cppCodeStyle();
|
||||
}
|
||||
|
||||
CppQtStyleIndenter::~CppQtStyleIndenter()
|
||||
{}
|
||||
CppQtStyleIndenter::~CppQtStyleIndenter() = default;
|
||||
|
||||
bool CppQtStyleIndenter::isElectricCharacter(const QChar &ch) const
|
||||
{
|
||||
@@ -157,8 +155,7 @@ void CppQtStyleIndenter::indent(QTextDocument *doc,
|
||||
|
||||
void CppQtStyleIndenter::setCodeStylePreferences(TextEditor::ICodeStylePreferences *preferences)
|
||||
{
|
||||
CppCodeStylePreferences *cppCodeStylePreferences
|
||||
= qobject_cast<CppCodeStylePreferences *>(preferences);
|
||||
auto cppCodeStylePreferences = qobject_cast<CppCodeStylePreferences *>(preferences);
|
||||
if (cppCodeStylePreferences)
|
||||
m_cppCodeStylePreferences = cppCodeStylePreferences;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user