modernize C++: avoid bind

In many cases std::bind() is kept because the code is much simpler
This commit is contained in:
wmayer
2023-08-08 19:10:49 +02:00
committed by wwmayer
parent 292196a606
commit d150fa7164
80 changed files with 240 additions and 30 deletions

View File

@@ -357,6 +357,7 @@ Application::Application(bool GUIenabled)
{
//App::GetApplication().Attach(this);
if (GUIenabled) {
//NOLINTBEGIN
App::GetApplication().signalNewDocument.connect(
std::bind(&Gui::Application::slotNewDocument, this, sp::_1, sp::_2));
App::GetApplication().signalDeleteDocument.connect(
@@ -369,6 +370,7 @@ Application::Application(bool GUIenabled)
std::bind(&Gui::Application::slotRelabelDocument, this, sp::_1));
App::GetApplication().signalShowHidden.connect(
std::bind(&Gui::Application::slotShowHidden, this, sp::_1));
//NOLINTEND
// install the last active language
ParameterGrp::handle hPGrp =
@@ -821,6 +823,7 @@ void Application::slotNewDocument(const App::Document& Doc, bool isMainDoc)
auto pDoc = new Gui::Document(const_cast<App::Document*>(&Doc),this);
d->documents[&Doc] = pDoc;
//NOLINTBEGIN
// connect the signals to the application for the new document
pDoc->signalNewObject.connect(std::bind(&Gui::Application::slotNewObject, this, sp::_1));
pDoc->signalDeletedObject.connect(std::bind(&Gui::Application::slotDeletedObject,
@@ -833,6 +836,7 @@ void Application::slotNewDocument(const App::Document& Doc, bool isMainDoc)
this, sp::_1));
pDoc->signalInEdit.connect(std::bind(&Gui::Application::slotInEdit, this, sp::_1));
pDoc->signalResetEdit.connect(std::bind(&Gui::Application::slotResetEdit, this, sp::_1));
//NOLINTEND
signalNewDocument(*pDoc, isMainDoc);
if (isMainDoc)