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 c765d64891
commit 948cbfccd9
80 changed files with 240 additions and 30 deletions

View File

@@ -240,8 +240,10 @@ class DocumentWeakPtrT::Private {
public:
Private(Gui::Document* doc) : _document(doc) {
if (doc) {
//NOLINTBEGIN
connectApplicationDeletedDocument = doc->signalDeleteDocument.connect(std::bind
(&Private::deletedDocument, this, sp::_1));
//NOLINTEND
}
}
@@ -323,6 +325,7 @@ public:
object = obj;
try {
if (obj) {
//NOLINTBEGIN
Gui::Document* doc = obj->getDocument();
indocument = true;
connectApplicationDeletedDocument = doc->signalDeleteDocument.connect(std::bind
@@ -331,6 +334,7 @@ public:
(&Private::createdObject, this, sp::_1));
connectDocumentDeletedObject = doc->signalDeletedObject.connect(std::bind
(&Private::deletedObject, this, sp::_1));
//NOLINTEND
}
}
catch (const Base::RuntimeError&) {
@@ -425,6 +429,7 @@ void DocumentObserver::attachDocument(Document* doc)
if (!doc)
return;
//NOLINTBEGIN
this->connectDocumentCreatedObject = doc->signalNewObject.connect(std::bind
(&DocumentObserver::slotCreatedObject, this, sp::_1));
this->connectDocumentDeletedObject = doc->signalDeletedObject.connect(std::bind
@@ -445,6 +450,7 @@ void DocumentObserver::attachDocument(Document* doc)
(&DocumentObserver::slotRedoDocument, this, sp::_1));
this->connectDocumentDelete = doc->signalDeleteDocument.connect(std::bind
(&DocumentObserver::slotDeleteDocument, this, sp::_1));
//NOLINTEND
}
void DocumentObserver::detachDocument()