From e13838f2afec561f5eb8c26cebf31fa67dcde81d Mon Sep 17 00:00:00 2001 From: nds Date: Thu, 2 Apr 2015 10:14:38 +0300 Subject: [PATCH] Flush the redisplay signal by the document in remove feature; do not change the concealed state during removeBackReference. --- src/Model/Model_Data.cpp | 5 ----- src/Model/Model_Data.h | 1 + src/Model/Model_Document.cpp | 2 ++ src/XGUI/XGUI_Workshop.cpp | 3 --- 4 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/Model/Model_Data.cpp b/src/Model/Model_Data.cpp index 53444bb6d..e8c1a980e 100644 --- a/src/Model/Model_Data.cpp +++ b/src/Model/Model_Data.cpp @@ -266,11 +266,6 @@ void Model_Data::removeBackReference(FeaturePtr theFeature, std::string theAttrI return; myRefsToMe.erase(anAttribute); - // TODO: check whether the concealed should be thrown down to the false value - std::shared_ptr aRes = - std::dynamic_pointer_cast(myObject); - if (aRes) - aRes->setIsConcealed(false); } void Model_Data::addBackReference(FeaturePtr theFeature, std::string theAttrID, diff --git a/src/Model/Model_Data.h b/src/Model/Model_Data.h index c057cede3..f3fd1c384 100644 --- a/src/Model/Model_Data.h +++ b/src/Model/Model_Data.h @@ -183,6 +183,7 @@ private: /// Removes all information about back references void eraseBackReferences(); /// Adds a back reference (with identifier which attribute references to this object + /// It does not change the consealment flag of the data object result /// \param theFeature feature referenced to this /// \param theAttrID identifier of the attribute that is references from theFeature to this void removeBackReference(FeaturePtr theFeature, std::string theAttrID); diff --git a/src/Model/Model_Document.cpp b/src/Model/Model_Document.cpp index ee8cebc14..754138db9 100644 --- a/src/Model/Model_Document.cpp +++ b/src/Model/Model_Document.cpp @@ -696,6 +696,8 @@ void Model_Document::removeFeature(FeaturePtr theFeature/*, const bool theCheck* } // event: feature is deleted ModelAPI_EventCreator::get()->sendDeleted(theFeature->document(), ModelAPI_Feature::group()); + // the redisplay signal should be flushed in order to erase the feature presentation in the viewer + Events_Loop::loop()->flush(EVENT_DISP); } } diff --git a/src/XGUI/XGUI_Workshop.cpp b/src/XGUI/XGUI_Workshop.cpp index 4b26dd4ee..5a6992d57 100644 --- a/src/XGUI/XGUI_Workshop.cpp +++ b/src/XGUI/XGUI_Workshop.cpp @@ -1458,9 +1458,6 @@ These features will be deleted also. Would you like to continue?")).arg(aNames), aDoc->removeFeature(aFeature); } } - // the update signal should be emitted obligatory in order to have a redisplay - // signal and hide the removed presentations in the viewer - Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_OBJECT_UPDATED)); return true; } -- 2.39.2