Gui: modernize C++: use default member init

This commit is contained in:
wmayer
2023-08-23 16:29:19 +02:00
committed by wwmayer
parent ee0fad4c90
commit 5a153e50ff
79 changed files with 220 additions and 325 deletions

View File

@@ -43,11 +43,7 @@
using namespace Gui;
MacroFile::MacroFile()
: openMacro(false)
{
}
MacroFile::MacroFile() = default;
void MacroFile::open(const char *sName)
{
@@ -136,10 +132,7 @@ void MacroFile::cancel()
// ----------------------------------------------------------------------------
MacroOutputBuffer::MacroOutputBuffer()
: totalLines(0)
{
}
MacroOutputBuffer::MacroOutputBuffer() = default;
void MacroOutputBuffer::addPendingLine(int type, const char* line)
{
@@ -170,12 +163,7 @@ void MacroOutputBuffer::incrementIfNoComment(int type)
// ----------------------------------------------------------------------------
MacroOutputOption::MacroOutputOption()
: recordGui(true)
, guiAsComment(true)
, scriptToPyConsole(true)
{
}
MacroOutputOption::MacroOutputOption() = default;
std::tuple<bool, bool> MacroOutputOption::values(int type) const
{
@@ -213,9 +201,7 @@ bool MacroOutputOption::isAppCommand(int type)
// ----------------------------------------------------------------------------
MacroManager::MacroManager()
: localEnv(true),
pyConsole(nullptr),
pyDebugger(new PythonDebugger())
: pyDebugger(new PythonDebugger())
{
// Attach to the Parametergroup regarding macros
this->params = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Macro");
@@ -358,7 +344,7 @@ namespace Gui {
class PythonRedirector
{
public:
PythonRedirector(const char* type, PyObject* obj) : std_out(type), out(obj), old(nullptr)
PythonRedirector(const char* type, PyObject* obj) : std_out(type), out(obj)
{
if (out) {
Base::PyGILStateLocker lock;
@@ -377,7 +363,7 @@ namespace Gui {
private:
const char* std_out;
PyObject* out;
PyObject* old;
PyObject* old{nullptr};
};
}