// Constructor *************************************************
-XGUI_DataModel::XGUI_DataModel(QObject* theParent) : QAbstractItemModel(theParent)
+XGUI_DataModel::XGUI_DataModel(QObject* theParent) : QAbstractItemModel(theParent),
+ myIsEventsProcessingStopped(false)
{
Events_Loop* aLoop = Events_Loop::loop();
aLoop->registerListener(this, Events_Loop::eventByName(EVENT_OBJECT_CREATED));
//******************************************************
void XGUI_DataModel::processEvent(const std::shared_ptr<Events_Message>& theMessage)
{
+ if (myIsEventsProcessingStopped)
+ return;
DocumentPtr aRootDoc = ModelAPI_Session::get()->moduleDocument();
std::string aRootType = myXMLReader->rootType();
std::string aSubType = myXMLReader->subType();
/// Initialises XML data model reader. It must be initialised before DataModel using.
void setXMLReader(Config_DataModelReader* theReader) { myXMLReader = theReader; }
+ /// Do not processing anymore events of model loop
+ void stopEventsProcessing() { myIsEventsProcessingStopped = true; }
+
signals:
/// Signal about tree had been rebuilt
void treeRebuilt();
QStringList listOfShowNotEmptyFolders(bool fromRoot = true) const;
Config_DataModelReader* myXMLReader;
+
+ bool myIsEventsProcessingStopped;
};
#endif
\ No newline at end of file
#include <XGUI_CustomPrs.h>
#include <XGUI_HistoryMenu.h>
#include <XGUI_QtEvents.h>
+#include <XGUI_DataModel.h>
#ifndef HAVE_SALOME
#include <AppElements_Button.h>
module()->closeDocument();
+ // data model need not process the document's signals about objects modifications as
+ // the document is closed
+ objectBrowser()->dataModel()->stopEventsProcessing();
+
SessionPtr aMgr = ModelAPI_Session::get();
aMgr->closeAll();
}