Salome HOME
Issue #1896: Inspect SALOME modules before loading of XML configurations
[modules/shaper.git] / src / Model / Model_Session.cpp
index 5bb981ea3b907559f97d3f920e5dbec30fde4a5d..cbe0e6a523da9f3ebc457e5f65ebf67ec3088a4f 100644 (file)
@@ -191,6 +191,7 @@ std::shared_ptr<ModelAPI_Document> Model_Session::moduleDocument()
   if (aFirstCall) {
     // to be sure that plugins are loaded,
     // even before the first "createFeature" call (in unit tests)
+
     LoadPluginsInfo();
     // creation of the root document is always outside of the transaction, so, avoid checking it
     setCheckTransactions(false);
@@ -266,7 +267,7 @@ void Model_Session::setActiveDocument(
         bool aWasChecked = myCheckTransactions;
         setCheckTransactions(false);
         TDF_LabelList anEmptyUpdated;
-        aDoc->objects()->synchronizeFeatures(anEmptyUpdated, true, true, true);
+        aDoc->objects()->synchronizeFeatures(anEmptyUpdated, true, true, false, true);
         if (aWasChecked)
             setCheckTransactions(true);
       }
@@ -329,7 +330,7 @@ std::shared_ptr<ModelAPI_Document> Model_Session::copy(
   TDF_CopyTool::Copy(aDS, aRT);
 
   TDF_LabelList anEmptyUpdated;
-  aNew->objects()->synchronizeFeatures(anEmptyUpdated, true, true, true);
+  aNew->objects()->synchronizeFeatures(anEmptyUpdated, true, true, true, true);
   return aNew;
 }
 
@@ -434,7 +435,7 @@ void Model_Session::LoadPluginsInfo()
 {
   if (myPluginsInfoLoaded)  // nothing to do
     return;
-
+  Config_ModuleReader::loadScript("salome.shaper.initConfig");
   // Read plugins information from XML files
   Config_ModuleReader aModuleReader(Config_FeatureMessage::MODEL_EVENT());
   aModuleReader.readAll();
@@ -473,22 +474,3 @@ int Model_Session::transactionID()
 {
   return ROOT_DOC->transactionID();
 }
-
-void Model_Session::forceLoadPlugin(const std::string& thePluginName)
-{
-  // load all information about plugins, features and attributes
-  LoadPluginsInfo();
-
-  // store name of current plugin for further restoring,
-  // because forceLoadPlugin may be called while loading another plugin
-  std::string aCurrentPluginName = myCurrentPluginName;
-
-  myCurrentPluginName = thePluginName;
-  if (myPluginObjs.find(myCurrentPluginName) == myPluginObjs.end()) {
-    // load plugin library if not yet done
-    Config_ModuleReader::loadPlugin(myCurrentPluginName);
-  }
-
-  // restore current plugin
-  myCurrentPluginName = aCurrentPluginName;
-}