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:
Alessandro Portale
2019-01-14 01:40:53 +01:00
parent 845af92889
commit 1d3d18a969
116 changed files with 461 additions and 555 deletions

View File

@@ -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;
}