PD: fix build failure with C++20

This commit is contained in:
wmayer
2021-12-01 23:24:16 +01:00
parent 58f33f350d
commit 2fd81006ea
2 changed files with 15 additions and 17 deletions

View File

@@ -452,22 +452,19 @@ void Workbench::activated()
Gui::Control().showTaskView();
// Let us be notified when a document is activated, so that we can update the ActivePartObject
Gui::Application::Instance->signalActiveDocument.connect(boost::bind(&Workbench::slotActiveDocument, this, bp::_1));
App::GetApplication().signalNewDocument.connect(boost::bind(&Workbench::slotNewDocument, this, bp::_1));
App::GetApplication().signalFinishRestoreDocument.connect(boost::bind(&Workbench::slotFinishRestoreDocument, this, bp::_1));
App::GetApplication().signalDeleteDocument.connect(boost::bind(&Workbench::slotDeleteDocument, this, bp::_1));
// Watch out for objects being added to the active document, so that we can add them to the body
//App::GetApplication().signalNewObject.connect(boost::bind(&Workbench::slotNewObject, this, bp::_1));
activeDoc = Gui::Application::Instance->signalActiveDocument.connect(boost::bind(&Workbench::slotActiveDocument, this, bp::_1));
createDoc = App::GetApplication().signalNewDocument.connect(boost::bind(&Workbench::slotNewDocument, this, bp::_1));
finishDoc = App::GetApplication().signalFinishRestoreDocument.connect(boost::bind(&Workbench::slotFinishRestoreDocument, this, bp::_1));
deleteDoc = App::GetApplication().signalDeleteDocument.connect(boost::bind(&Workbench::slotDeleteDocument, this, bp::_1));
}
void Workbench::deactivated()
{
// Let us be notified when a document is activated, so that we can update the ActivePartObject
Gui::Application::Instance->signalActiveDocument.disconnect(boost::bind(&Workbench::slotActiveDocument, this, bp::_1));
App::GetApplication().signalNewDocument.disconnect(boost::bind(&Workbench::slotNewDocument, this, bp::_1));
App::GetApplication().signalFinishRestoreDocument.disconnect(boost::bind(&Workbench::slotFinishRestoreDocument, this, bp::_1));
App::GetApplication().signalDeleteDocument.disconnect(boost::bind(&Workbench::slotDeleteDocument, this, bp::_1));
//App::GetApplication().signalNewObject.disconnect(boost::bind(&Workbench::slotNewObject, this, bp::_1));
activeDoc.disconnect();
createDoc.disconnect();
finishDoc.disconnect();
deleteDoc.disconnect();
removeTaskWatcher();
// reset the active Body

View File

@@ -24,7 +24,9 @@
#ifndef PARTDESIGN_WORKBENCH_H
#define PARTDESIGN_WORKBENCH_H
#include <boost_signals2.hpp>
#include <Gui/Workbench.h>
#include <Mod/PartDesign/PartDesignGlobal.h>
namespace Gui {
@@ -36,12 +38,6 @@ class ViewProviderDocumentObject;
namespace PartDesignGui {
// pointer to the active assembly object
//extern PartDesign::Body *ActivePartObject;
//extern Gui::Document *ActiveGuiDoc;
//extern App::Document *ActiveAppDoc;
//extern Gui::ViewProviderDocumentObject *ActiveVp;
/**
* @author Werner Mayer
*/
@@ -80,6 +76,11 @@ private:
void _switchToDocument(const App::Document* doc);
private:
boost::signals2::connection activeDoc;
boost::signals2::connection createDoc;
boost::signals2::connection finishDoc;
boost::signals2::connection deleteDoc;
};
} // namespace PartDesignGui