Macros: Modernize

* Replace 0 with nullptr
* Remove redundant pimpl
* Use inline member initialization

Started-by: Laurent Montel <laurent.montel@kdab.com>
Change-Id: I15ace2581c13ecf24b7c947972b9435fbcaa12ab
Reviewed-by: Laurent Montel <laurent.montel@kdab.com>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Orgad Shaneh
2017-02-27 15:47:47 +01:00
committed by Orgad Shaneh
parent e99b86e8ca
commit 0269bf537b
7 changed files with 16 additions and 52 deletions

View File

@@ -96,8 +96,8 @@ public:
MacroManager *q;
QMap<QString, Macro *> macros;
QMap<QString, QAction *> actions;
Macro *currentMacro;
bool isRecording;
Macro *currentMacro = nullptr;
bool isRecording = false;
QList<IMacroHandler*> handlers;
@@ -115,9 +115,7 @@ public:
};
MacroManager::MacroManagerPrivate::MacroManagerPrivate(MacroManager *qq):
q(qq),
currentMacro(0),
isRecording(false)
q(qq)
{
// Load existing macros
initialize();
@@ -179,7 +177,7 @@ void MacroManager::MacroManagerPrivate::removeMacro(const QString &name)
// Remove macro from the map
Macro *macro = macros.take(name);
if (macro == currentMacro)
currentMacro = 0;
currentMacro = nullptr;
delete macro;
}
@@ -243,7 +241,7 @@ void MacroManager::MacroManagerPrivate::showSaveDialog()
// ---------- MacroManager ------------
MacroManager *MacroManager::m_instance = 0;
MacroManager *MacroManager::m_instance = nullptr;
MacroManager::MacroManager(QObject *parent) :
QObject(parent),