]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Avoid hung-up on exit of SALOME when NewGeom is non active
authorvsv <vitaly.smetannikov@opencascade.com>
Tue, 23 Jun 2015 14:25:19 +0000 (17:25 +0300)
committervsv <vitaly.smetannikov@opencascade.com>
Tue, 23 Jun 2015 14:25:31 +0000 (17:25 +0300)
src/NewGeom/NewGeom_Module.cpp
src/XGUI/XGUI_Workshop.cpp

index f5927a5efc51d44cac9c0efb6ce2ef8c596dc722..547ed1ab5778302b0d8f8a90642ea3e4e099ecf7 100644 (file)
@@ -443,8 +443,11 @@ void NewGeom_Module::addDesktopMenuSeparator(const char* theMenuSourceText, cons
 QList<QAction*> NewGeom_Module::commandList() const
 {
   QList<QAction*> aActions;
-  for (int i = 0; i < myActionsList.size(); i++)
-    aActions.append(action(i));
+  for (int i = 0; i < myActionsList.size(); i++) {
+    QAction* aCmd = action(i);
+    if (aCmd && myActionsList.contains(aCmd->data().toString()))
+      aActions.append(aCmd);
+  }
   return aActions;
 }
 
index ec7ddf45abc9553a84184f3ccbdea0bdddf103fc..1b8d586e0ed832ff1610b32856909c0e27c96c1d 100644 (file)
@@ -1118,20 +1118,16 @@ void XGUI_Workshop::updateCommandStatus()
   }
   SessionPtr aMgr = ModelAPI_Session::get();
   if (aMgr->hasModuleDocument()) {
-    QAction *aUndoCmd, *aRedoCmd;
     foreach(QAction* aCmd, aCommands) {
       QString aId = aCmd->data().toString();
       if (aId == "UNDO_CMD")
-        aUndoCmd = aCmd;
+        aCmd->setEnabled(myModule->canUndo());
       else if (aId == "REDO_CMD")
-        aRedoCmd = aCmd;
+        aCmd->setEnabled(myModule->canRedo());
       else
         // Enable all commands
         aCmd->setEnabled(true);
     }
-
-    aUndoCmd->setEnabled(myModule->canUndo());
-    aRedoCmd->setEnabled(myModule->canRedo());
     updateHistory();
   } else {
     foreach(QAction* aCmd, aCommands) {