App: Prepare for clang-format

This commit is contained in:
wmayer
2024-06-03 10:34:17 +02:00
committed by wwmayer
parent fd7f6039b6
commit 6fb7c51c18
15 changed files with 55 additions and 11 deletions

View File

@@ -175,6 +175,7 @@ AppExport std::map<std::string, std::string> Application::mConfig;
//**************************************************************************
// Construction and destruction
// clang-format off
PyDoc_STRVAR(FreeCAD_doc,
"The functions in the FreeCAD module allow working with documents.\n"
"The FreeCAD instance provides a list of references of documents which\n"
@@ -237,6 +238,7 @@ init_image_module()
};
return PyModule_Create(&ImageModuleDef);
}
// clang-format on
Application::Application(std::map<std::string,std::string> &mConfig)
: _mConfig(mConfig)
@@ -264,6 +266,7 @@ void Application::setupPythonTypes()
}
Py::Module(pAppModule).setAttr(std::string("ActiveDocument"),Py::None());
// clang-format off
static struct PyModuleDef ConsoleModuleDef = {
PyModuleDef_HEAD_INIT,
"__FreeCADConsole__", Console_doc, -1,
@@ -371,8 +374,10 @@ void Application::setupPythonTypes()
Base::Vector2dPy::init_type();
Base::Interpreter().addType(Base::Vector2dPy::type_object(),
pBaseModule,"Vector2d");
// clang-format on
}
// clang-format off
void Application::setupPythonException(PyObject* module)
{
// Define custom Python exception types
@@ -421,6 +426,7 @@ void Application::setupPythonException(PyObject* module)
Py_INCREF(Base::PyExc_FC_CADKernelError);
PyModule_AddObject(module, "CADKernelError", Base::PyExc_FC_CADKernelError);
}
// clang-format on
//**************************************************************************
// Interface
@@ -488,6 +494,7 @@ Document* Application::newDocument(const char * Name, const char * UserName, boo
_pActiveDoc = doc;
//NOLINTBEGIN
// clang-format off
// connect the signals to the application for the new document
_pActiveDoc->signalBeforeChange.connect(std::bind(&App::Application::slotBeforeChangeDocument, this, sp::_1, sp::_2));
_pActiveDoc->signalChanged.connect(std::bind(&App::Application::slotChangedDocument, this, sp::_1, sp::_2));
@@ -508,6 +515,7 @@ Document* Application::newDocument(const char * Name, const char * UserName, boo
_pActiveDoc->signalStartSave.connect(std::bind(&App::Application::slotStartSaveDocument, this, sp::_1, sp::_2));
_pActiveDoc->signalFinishSave.connect(std::bind(&App::Application::slotFinishSaveDocument, this, sp::_1, sp::_2));
_pActiveDoc->signalChangePropertyEditor.connect(std::bind(&App::Application::slotChangePropertyEditor, this, sp::_1, sp::_2));
// clang-format on
//NOLINTEND
// make sure that the active document is set in case no GUI is up
@@ -1921,6 +1929,7 @@ void Application::init(int argc, char ** argv)
}
}
// clang-format off
void Application::initTypes()
{
// Base types
@@ -2484,6 +2493,7 @@ void processProgramOptions(const variables_map& vm, std::map<std::string,std::st
}
}
}
// clang-format on
void Application::initConfig(int argc, char ** argv)
{