From 49dc72f9ae537e39e40e5c5f319d5b3744c680d0 Mon Sep 17 00:00:00 2001 From: mpv Date: Wed, 24 Sep 2014 08:45:38 +0400 Subject: [PATCH] Wrap the rebuild operation by transaction braces to avoid warnings and allow to undo the rebuilding. --- src/XGUI/XGUI_Workshop.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/XGUI/XGUI_Workshop.cpp b/src/XGUI/XGUI_Workshop.cpp index 25866c87c..1f3bee21a 100644 --- a/src/XGUI/XGUI_Workshop.cpp +++ b/src/XGUI/XGUI_Workshop.cpp @@ -789,9 +789,17 @@ void XGUI_Workshop::onRedo() //****************************************************** void XGUI_Workshop::onRebuild() { + SessionPtr aMgr = ModelAPI_Session::get(); + bool aWasOperation = aMgr->isOperation(); // keep this value + if (!aWasOperation) { + aMgr->startOperation(); + } static const Events_ID aRebuildEvent = Events_Loop::loop()->eventByName("Rebuild"); Events_Loop::loop()->send(boost::shared_ptr( new Events_Message(aRebuildEvent, this))); + if (!aWasOperation) { + aMgr->finishOperation(); + } } //****************************************************** -- 2.39.2