From d9a49591998f26df0e8c8581ce7e9bf350432996 Mon Sep 17 00:00:00 2001 From: nge Date: Thu, 3 Jun 2010 17:45:25 +0000 Subject: [PATCH] Draft : First bversion of Observer on kernel side. --- src/SALOMEDSImpl/SALOMEDSImpl_GenericAttribute.cxx | 1 + src/SALOMEDSImpl/SALOMEDSImpl_StudyBuilder.cxx | 11 +++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_GenericAttribute.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_GenericAttribute.cxx index 0f7baf1eb..7f3544df1 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_GenericAttribute.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_GenericAttribute.cxx @@ -85,6 +85,7 @@ void SALOMEDSImpl_GenericAttribute::SetModifyFlag() if(aLabel.IsNull()) return; SALOMEDSImpl_Study* aStudy = SALOMEDSImpl_Study::GetStudy(aLabel); + if(aStudy) aStudy->modifySO_Notification(GetSObject()); if(aStudy) aStudy->Modify(); } diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_StudyBuilder.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_StudyBuilder.cxx index 38610cb79..804d5e307 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_StudyBuilder.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_StudyBuilder.cxx @@ -74,9 +74,10 @@ SALOMEDSImpl_StudyBuilder::~SALOMEDSImpl_StudyBuilder() //============================================================================ SALOMEDSImpl_SComponent SALOMEDSImpl_StudyBuilder::NewComponent(const std::string& DataType) { + std::cerr << "I'm here newComponent " << std::endl; _errorCode = ""; CheckLocked(); - + SALOMEDSImpl_SComponent sco; if(DataType.size() == 0) return sco; @@ -138,6 +139,7 @@ bool SALOMEDSImpl_StudyBuilder::RemoveComponent(const SALOMEDSImpl_SComponent& a //============================================================================ SALOMEDSImpl_SObject SALOMEDSImpl_StudyBuilder::NewObject(const SALOMEDSImpl_SObject& theFatherObject) { + std::cerr << "I'm here newObject " << std::endl; _errorCode = ""; CheckLocked(); @@ -195,7 +197,6 @@ bool SALOMEDSImpl_StudyBuilder::RemoveObject(const SALOMEDSImpl_SObject& anObjec } if(_callbackOnRemove) _callbackOnRemove->OnRemoveSObject(anObject); - _study->removeSO_Notification(anObject); DF_Label Lab = anObject.GetLabel(); @@ -214,6 +215,7 @@ bool SALOMEDSImpl_StudyBuilder::RemoveObject(const SALOMEDSImpl_SObject& anObjec Lab.ForgetAllAttributes(); _doc->SetModified(true); + _study->removeSO_Notification(anObject); return true; } @@ -233,7 +235,6 @@ bool SALOMEDSImpl_StudyBuilder::RemoveObjectWithChildren(const SALOMEDSImpl_SObj } if(_callbackOnRemove) _callbackOnRemove->OnRemoveSObject(anObject); - _study->removeSO_Notification(anObject); DF_Label Lab = anObject.GetLabel(); @@ -265,6 +266,7 @@ bool SALOMEDSImpl_StudyBuilder::RemoveObjectWithChildren(const SALOMEDSImpl_SObj Lab.ForgetAllAttributes(true); _doc->SetModified(true); + _study->removeSO_Notification(anObject); return true; } @@ -417,7 +419,7 @@ bool SALOMEDSImpl_StudyBuilder::LoadWith(const SALOMEDSImpl_SComponent& anSCO, } else { _errorCode = "No persistent file"; } - + return true; } @@ -547,6 +549,7 @@ bool SALOMEDSImpl_StudyBuilder::RemoveAttribute(const SALOMEDSImpl_SObject& anOb Lab.ForgetAttribute (SALOMEDSImpl_SObject::GetGUID(aTypeOfAttribute)); _doc->SetModified(true); + _study->modifySO_Notification(anObject); return true; } -- 2.39.2