Salome HOME
updated copyright message
[modules/gui.git] / src / SalomeApp / SalomeApp_Study.cxx
index c680652323e8e61e629fc0da38948e23930b00cc..d08a14074cda308ba5ffeca603f41c893da2d5f0 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2020  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2023  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -190,17 +190,16 @@ public:
           /* Define visibility state */
           bool isComponent = dynamic_cast<SalomeApp_ModuleObject*>( suit_obj ) != 0;
           if ( suit_obj && !isComponent && myStudy->visibilityState( theID.c_str() ) == Qtx::UnpresentableState ) {
-            QString moduleTitle = ((CAM_Application*)myStudy->application())->moduleTitle(suit_obj->componentDataType());
-            if (!moduleTitle.isEmpty()) {
-              LightApp_Displayer* aDisplayer = LightApp_Displayer::FindDisplayer(moduleTitle,false);
-              if (aDisplayer) {
-                if(aDisplayer->canBeDisplayed(theID.c_str())) {
-                  myStudy->setVisibilityState( theID.c_str(), Qtx::HiddenState ); //hide the just added object
-                  //MESSAGE("Object with entry : "<< theID <<" CAN be displayed !!!");
-                }
-                //else
-                  //MESSAGE("Object with entry : "<< theID <<" CAN'T be displayed !!!");
+            LightApp_Displayer* aDisplayer = LightApp_Displayer::FindDisplayer
+              (suit_obj->componentDataType(),false);
+            if (aDisplayer) {
+              if (aDisplayer->canBeDisplayed(theID.c_str())) {
+                //hide the just added object
+                myStudy->setVisibilityState( theID.c_str(), Qtx::HiddenState );
+                //MESSAGE("Object with entry : "<< theID <<" CAN be displayed !!!");
               }
+              //else
+              //  MESSAGE("Object with entry : "<< theID <<" CAN'T be displayed !!!");
             }
           }
         } // END: work with tree nodes structure
@@ -323,17 +322,15 @@ public:
         /* Define visibility state */
         bool isComponent = dynamic_cast<SalomeApp_ModuleObject*>( suit_obj ) != 0;
         if ( suit_obj && !isComponent ) {
-          QString moduleTitle = ((CAM_Application*)myStudy->application())->moduleTitle(suit_obj->componentDataType());
-          if (!moduleTitle.isEmpty()) {
-            LightApp_Displayer* aDisplayer = LightApp_Displayer::FindDisplayer(moduleTitle,false);
-            if (aDisplayer) {
-              if(aDisplayer->canBeDisplayed(theID.c_str())) {
-                myStudy->setVisibilityState( theID.c_str(), Qtx::HiddenState );
-                //MESSAGE("Object with entry : "<< theID <<" CAN be displayed !!!");
-              }
-              //else
-                //MESSAGE("Object with entry : "<< theID <<" CAN'T be displayed !!!");
+          LightApp_Displayer* aDisplayer = LightApp_Displayer::FindDisplayer
+            (suit_obj->componentDataType(),false);
+          if (aDisplayer) {
+            if (aDisplayer->canBeDisplayed(theID.c_str())) {
+              myStudy->setVisibilityState( theID.c_str(), Qtx::HiddenState );
+              //MESSAGE("Object with entry : "<< theID <<" CAN be displayed !!!");
             }
+            //else
+            //  MESSAGE("Object with entry : "<< theID <<" CAN'T be displayed !!!");
           }
         }
         break;