Salome HOME
Issue #2998: Add help description for automatic creation of constraints
[modules/shaper.git] / src / XGUI / XGUI_Workshop.cpp
index 88386696d1aa2190e1dfcbac18a8a6be5686f142..3e552186df412c9db79d1f4484239e18c2992397 100644 (file)
@@ -219,11 +219,9 @@ XGUI_Workshop::XGUI_Workshop(XGUI_SalomeConnector* theConnector)
 
   // Load translations
   QStringList aLangs;
-  //aLangs << "*_en.ts"; // load by default eng translations
+  aLangs << "*_en.ts"; // load by default eng translations
   QString aCurrLang = aResMgr->stringValue("language", "language", "en");
-  if(aCurrLang == "en") {
-    aLangs << "*_en.ts";
-  } else {
+  if(aCurrLang != "en") {
     aLangs << "*_" + aCurrLang + ".ts"; // then replace with translated files
   }
 
@@ -1818,17 +1816,19 @@ void XGUI_Workshop::deleteObjects()
   if (!(hasResult || hasFeature || hasParameter || hasFolder))
     return;
 
-  // Remove from the list non-deletable objects: infinite constuctions which are not in history
+  // Remove from the list non-deletable objects: infinite constructions which are not in history
   bool notDelete = true;
   QObjectPtrList::iterator aIt;
   for (aIt = anObjects.begin(); aIt != anObjects.end(); aIt++) {
     ObjectPtr aObj = (*aIt);
     ResultConstructionPtr aConstr = std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(aObj);
     FeaturePtr aFeature = ModelAPI_Feature::feature(aObj);
-    notDelete = (!aFeature->isInHistory()) && aConstr->isInfinite();
-    if (notDelete) {
-      anObjects.removeAll(aObj);
-      aIt--;
+    if (aFeature) {
+      notDelete = (!aFeature->isInHistory()) && aConstr->isInfinite();
+      if (notDelete) {
+        anObjects.removeAll(aObj);
+        aIt--;
+      }
     }
   }
   // delete objects