App/DocumentObserver: make slot methods unimplemented rather pure-virtual and clenup derived classes accordingly
This commit is contained in:
parent
3f8350157a
commit
0603c3fb61
|
@ -61,15 +61,20 @@ public:
|
|||
|
||||
private:
|
||||
/** Checks if a new document was created */
|
||||
virtual void slotCreatedDocument(const App::Document& Doc) = 0;
|
||||
virtual void slotCreatedDocument(const App::Document& Doc)
|
||||
{}
|
||||
/** Checks if the given document is about to be closed */
|
||||
virtual void slotDeletedDocument(const App::Document& Doc) = 0;
|
||||
virtual void slotDeletedDocument(const App::Document& Doc)
|
||||
{}
|
||||
/** Checks if a new object was added. */
|
||||
virtual void slotCreatedObject(const App::DocumentObject& Obj) = 0;
|
||||
virtual void slotCreatedObject(const App::DocumentObject& Obj)
|
||||
{}
|
||||
/** Checks if the given object is about to be removed. */
|
||||
virtual void slotDeletedObject(const App::DocumentObject& Obj) = 0;
|
||||
virtual void slotDeletedObject(const App::DocumentObject& Obj)
|
||||
{}
|
||||
/** The property of an observed object has changed */
|
||||
virtual void slotChangedObject(const App::DocumentObject& Obj, const App::Property& Prop) = 0;
|
||||
virtual void slotChangedObject(const App::DocumentObject& Obj, const App::Property& Prop)
|
||||
{}
|
||||
|
||||
protected:
|
||||
Document* getDocument() const;
|
||||
|
|
|
@ -80,10 +80,6 @@ void ActiveAnalysisObserver::highlightActiveObject(const Gui::HighlightMode& mod
|
|||
activeDocument->signalHighlightObject(*activeView, mode, on);
|
||||
}
|
||||
|
||||
void ActiveAnalysisObserver::slotCreatedDocument(const App::Document& Doc)
|
||||
{
|
||||
}
|
||||
|
||||
void ActiveAnalysisObserver::slotDeletedDocument(const App::Document& Doc)
|
||||
{
|
||||
App::Document* d = getDocument();
|
||||
|
@ -95,10 +91,6 @@ void ActiveAnalysisObserver::slotDeletedDocument(const App::Document& Doc)
|
|||
}
|
||||
}
|
||||
|
||||
void ActiveAnalysisObserver::slotCreatedObject(const App::DocumentObject& Obj)
|
||||
{
|
||||
}
|
||||
|
||||
void ActiveAnalysisObserver::slotDeletedObject(const App::DocumentObject& Obj)
|
||||
{
|
||||
if (activeObject == &Obj) {
|
||||
|
@ -106,7 +98,3 @@ void ActiveAnalysisObserver::slotDeletedObject(const App::DocumentObject& Obj)
|
|||
activeView = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void ActiveAnalysisObserver::slotChangedObject(const App::DocumentObject& Obj, const App::Property& Prop)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -50,11 +50,8 @@ private:
|
|||
ActiveAnalysisObserver();
|
||||
~ActiveAnalysisObserver();
|
||||
|
||||
void slotCreatedDocument(const App::Document& Doc);
|
||||
void slotDeletedDocument(const App::Document& Doc);
|
||||
void slotCreatedObject(const App::DocumentObject& Obj);
|
||||
void slotDeletedObject(const App::DocumentObject& Obj);
|
||||
void slotChangedObject(const App::DocumentObject& Obj, const App::Property& Prop);
|
||||
|
||||
private:
|
||||
static ActiveAnalysisObserver* inst;
|
||||
|
|
|
@ -148,10 +148,6 @@ void DlgEvaluateMeshImp::slotChangedObject(const App::DocumentObject& Obj, const
|
|||
}
|
||||
}
|
||||
|
||||
void DlgEvaluateMeshImp::slotCreatedDocument(const App::Document& Doc)
|
||||
{
|
||||
}
|
||||
|
||||
void DlgEvaluateMeshImp::slotDeletedDocument(const App::Document& Doc)
|
||||
{
|
||||
if (&Doc == getDocument()) {
|
||||
|
|
|
@ -72,8 +72,6 @@ public:
|
|||
void setMesh( Mesh::Feature* );
|
||||
|
||||
private:
|
||||
/** Checks if a new document was created */
|
||||
void slotCreatedDocument(const App::Document& Doc);
|
||||
/** Checks if the given document is about to be closed */
|
||||
void slotDeletedDocument(const App::Document& Doc);
|
||||
/** Checks if a new object was added. */
|
||||
|
|
|
@ -224,14 +224,6 @@ void ViewProviderMeshCurvature::init(const Mesh::PropertyCurvatureList* pCurvInf
|
|||
pcColorBar->setRange( fMin, fMax, 3 );
|
||||
}
|
||||
|
||||
void ViewProviderMeshCurvature::slotCreatedObject(const App::DocumentObject& Obj)
|
||||
{
|
||||
}
|
||||
|
||||
void ViewProviderMeshCurvature::slotDeletedObject(const App::DocumentObject& Obj)
|
||||
{
|
||||
}
|
||||
|
||||
void ViewProviderMeshCurvature::slotChangedObject(const App::DocumentObject& Obj, const App::Property& Prop)
|
||||
{
|
||||
// we get this for any object for that a property has changed. Thus, we must regard that object
|
||||
|
@ -248,14 +240,6 @@ void ViewProviderMeshCurvature::slotChangedObject(const App::DocumentObject& Obj
|
|||
}
|
||||
}
|
||||
|
||||
void ViewProviderMeshCurvature::slotCreatedDocument(const App::Document& Doc)
|
||||
{
|
||||
}
|
||||
|
||||
void ViewProviderMeshCurvature::slotDeletedDocument(const App::Document& Doc)
|
||||
{
|
||||
}
|
||||
|
||||
void ViewProviderMeshCurvature::attach(App::DocumentObject *pcFeat)
|
||||
{
|
||||
// creats the standard viewing modes
|
||||
|
|
|
@ -101,15 +101,6 @@ protected:
|
|||
private:
|
||||
void init(const Mesh::PropertyCurvatureList *prop);
|
||||
|
||||
/** Checks if a new document was created */
|
||||
void slotCreatedDocument(const App::Document& Doc);
|
||||
/** Checks if the given document is about to be closed */
|
||||
void slotDeletedDocument(const App::Document& Doc);
|
||||
/** Checks if a new object was added. */
|
||||
void slotCreatedObject(const App::DocumentObject& Obj);
|
||||
/** Checks if the given object is about to be removed. */
|
||||
void slotDeletedObject(const App::DocumentObject& Obj);
|
||||
/** The property of an observed object has changed */
|
||||
void slotChangedObject(const App::DocumentObject& Obj, const App::Property& Prop);
|
||||
|
||||
protected:
|
||||
|
|
|
@ -254,10 +254,6 @@ void DocumentProtector::init()
|
|||
moveToThread(QCoreApplication::instance()->thread());
|
||||
}
|
||||
|
||||
void DocumentProtector::slotCreatedDocument(const App::Document& Doc)
|
||||
{
|
||||
}
|
||||
|
||||
void DocumentProtector::slotDeletedDocument(const App::Document& Doc)
|
||||
{
|
||||
if (&Doc == getDocument()) {
|
||||
|
@ -265,18 +261,6 @@ void DocumentProtector::slotDeletedDocument(const App::Document& Doc)
|
|||
}
|
||||
}
|
||||
|
||||
void DocumentProtector::slotCreatedObject(const App::DocumentObject& Obj)
|
||||
{
|
||||
}
|
||||
|
||||
void DocumentProtector::slotDeletedObject(const App::DocumentObject& Obj)
|
||||
{
|
||||
}
|
||||
|
||||
void DocumentProtector::slotChangedObject(const App::DocumentObject& Obj, const App::Property& Prop)
|
||||
{
|
||||
}
|
||||
|
||||
void DocumentProtector::validate()
|
||||
{
|
||||
if (!this->getDocument())
|
||||
|
|
|
@ -61,18 +61,6 @@ public:
|
|||
{
|
||||
}
|
||||
private:
|
||||
void slotCreatedDocument(const App::Document& Doc)
|
||||
{
|
||||
}
|
||||
void slotDeletedDocument(const App::Document& Doc)
|
||||
{
|
||||
}
|
||||
void slotCreatedObject(const App::DocumentObject& Obj)
|
||||
{
|
||||
}
|
||||
void slotDeletedObject(const App::DocumentObject& Obj)
|
||||
{
|
||||
}
|
||||
void slotChangedObject(const App::DocumentObject& Obj, const App::Property& Prop)
|
||||
{
|
||||
if (object == &Obj && Prop.getTypeId() == Part::PropertyGeometryList::getClassTypeId()) {
|
||||
|
|
|
@ -42,24 +42,6 @@ SheetObserver::SheetObserver(App::Document * document, PropertySheet *_sheet)
|
|||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Unimplemented.
|
||||
*
|
||||
*/
|
||||
|
||||
void SheetObserver::slotCreatedDocument(const App::Document &Doc)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Unimplemented.
|
||||
*
|
||||
*/
|
||||
|
||||
void SheetObserver::slotDeletedDocument(const App::Document &Doc)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Invalidate cells that depend on this document object.
|
||||
*
|
||||
|
|
|
@ -33,8 +33,6 @@ class SheetObserver : public App::DocumentObserver {
|
|||
public:
|
||||
SheetObserver(App::Document* document, PropertySheet *_sheet);
|
||||
~SheetObserver() { }
|
||||
virtual void slotCreatedDocument(const App::Document& Doc);
|
||||
virtual void slotDeletedDocument(const App::Document& Doc);
|
||||
virtual void slotCreatedObject(const App::DocumentObject& Obj);
|
||||
virtual void slotDeletedObject(const App::DocumentObject& Obj);
|
||||
virtual void slotChangedObject(const App::DocumentObject& Obj, const App::Property& Prop);
|
||||
|
|
Loading…
Reference in New Issue
Block a user