aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/texteditor/icodestylepreferences.cpp
diff options
context:
space:
mode:
authorOrgad Shaneh <orgad.shaneh@audiocodes.com>2018-09-20 01:16:01 +0300
committerOrgad Shaneh <orgads@gmail.com>2018-09-20 08:48:49 +0000
commit41dee83becb19aa5fadae8ef9469216bcab1440c (patch)
tree2fd37b0111d0e3b78976fa8f8fbaefff30f49003 /src/plugins/texteditor/icodestylepreferences.cpp
parent439bc225e1c0f3d964c8a3da6e9757a821a5944c (diff)
TextEditor: Modernize
override, auto, nullptr, member initializers. Change-Id: I04c6ebb683849568973bd7782fb5a3279267141e Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Diffstat (limited to 'src/plugins/texteditor/icodestylepreferences.cpp')
-rw-r--r--src/plugins/texteditor/icodestylepreferences.cpp18
1 files changed, 6 insertions, 12 deletions
diff --git a/src/plugins/texteditor/icodestylepreferences.cpp b/src/plugins/texteditor/icodestylepreferences.cpp
index 76ed2001b2..bebd25f29f 100644
--- a/src/plugins/texteditor/icodestylepreferences.cpp
+++ b/src/plugins/texteditor/icodestylepreferences.cpp
@@ -40,18 +40,12 @@ namespace Internal {
class ICodeStylePreferencesPrivate
{
public:
- ICodeStylePreferencesPrivate()
- : m_pool(0),
- m_currentDelegate(0),
- m_readOnly(false)
- {}
-
- CodeStylePool *m_pool;
- ICodeStylePreferences *m_currentDelegate;
+ CodeStylePool *m_pool = nullptr;
+ ICodeStylePreferences *m_currentDelegate = nullptr;
TabSettings m_tabSettings;
QByteArray m_id;
QString m_displayName;
- bool m_readOnly;
+ bool m_readOnly = false;
};
}
@@ -128,7 +122,7 @@ QVariant ICodeStylePreferences::currentValue() const
ICodeStylePreferences *ICodeStylePreferences::currentPreferences() const
{
- ICodeStylePreferences *prefs = (ICodeStylePreferences *)this;
+ auto prefs = (ICodeStylePreferences *)this;
while (prefs->currentDelegate())
prefs = prefs->currentDelegate();
return prefs;
@@ -144,7 +138,7 @@ void ICodeStylePreferences::setDelegatingPool(CodeStylePool *pool)
if (pool == d->m_pool)
return;
- setCurrentDelegate(0);
+ setCurrentDelegate(nullptr);
if (d->m_pool) {
disconnect(d->m_pool, &CodeStylePool::codeStyleRemoved,
this, &ICodeStylePreferences::codeStyleRemoved);
@@ -247,7 +241,7 @@ void ICodeStylePreferences::codeStyleRemoved(ICodeStylePreferences *preferences)
CodeStylePool *pool = delegatingPool();
QList<ICodeStylePreferences *> codeStyles = pool->codeStyles();
const int idx = codeStyles.indexOf(preferences);
- ICodeStylePreferences *newCurrentPreferences = 0;
+ ICodeStylePreferences *newCurrentPreferences = nullptr;
int i = idx + 1;
// go forward
while (i < codeStyles.count()) {